Skip to content

How to use the github-actions bot #25863

Answered by oldskool
lionel-faber asked this question in Actions
Discussion options

You must be logged in to vote

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:

jobs:
  assign:
    runs-on: ubuntu-latest

steps:
- name: Assign user
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X POST -d '{"assignees": ["oldskool"]}'
https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/assignees

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

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants