How to use the github-actions bot

I’ve created a couple of GitHub actions that add labels to an issue and assign it to a user. But, after the action executes the issue reflects that user-a has added labels a and b. This is probably because I’m using user-as API token to authorise the adding of theses labels.

I’m looking for a way to authorise the github-actions[bot] to perform these operations so that users would know that they were triggered by automation.

Any help / links are appreciated. Thanks!

The GitHub Actions bot already has the permissions you want by default. Simply call the GitHub API using the token that is generated by GitHub Actions in the GITHUB_TOKEN secret. For example:

    runs-on: ubuntu-latest

      - name: Assign user
          PR_NUMBER: ${{ github.event.pull_request.number }}
        run: |
          curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST -d '{"assignees": ["oldskool"]}' \

Will result in the github-actions bot assigning me to the PR that triggered this workflow:


Thanks so much @oldskool 

I had generated an API token and was using that to authenticate the Github API.
I was not aware of the default API token available already!