How to create issues via an action

I was trying to create an GitHub action (here) that open an issue or at least adds a comment to an existing issue when an event occurs.
However, whenever I try to do it using curl, it says needs authentication. I tried authenticating to my account via ${{ secrets.GITHUB_TOKEN }} but I get an error.
What am I doing wrong?
I am not sure if this is the correct place to ask for help, but the docs did not provide any guidance.
Is this require something special or can it just be done via normal actions or the REST api?

Thank you!

Hi, firstly we wanted to mention actions/github-script, as it might help you in the future to make API calls easier:

For the error itself, we weren’t able to find the specific workflow run demonstrating this error, but most likely you could resolve this issue by using a PAT instead of the GITHUB_TOKEN:

https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

You can then add it as a secret, and use the secret in the workflow to make the API call:

https://docs.github.com/en/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow

1 Like

@github-support I am a bit busy, but I will look at that later.
Thank you for your help!

I have found a solution.
Thanks!

another option: it appears that the runners have the github cli installed on them by default

@dradetsky Thanks!
I will look into GitHub cli!