GitHub Actions: Automatically assign pull request authors.
In most cases, the pull request author should be assigned as an assignee of the pull request.
This action automatically assigns the pull request author as an assignee.
# .github/workflows/auto-author-assign.yml
name: Auto Author Assign
on:
pull_request_target:
types: [ opened, reopened ]
permissions:
pull-requests: write
jobs:
assign-author:
runs-on: ubuntu-slim
steps:
- uses: step-security/auto-author-assign@v3You can specify your own token.
jobs:
assign-author:
runs-on: ubuntu-slim
steps:
- uses: step-security/auto-author-assign@v3
with:
repo-token: ${{ secrets.YOUR_TOKEN }}If not specified, GITHUB_TOKEN will be used by default.
An issue's author can be automatically assigned as an issue assignee.
- Add
issuesto the trigger - Add
issues: writeto the permissions
on:
issues:
types: [ opened, reopened ]
pull_request_target:
types: [ opened, reopened ]
permissions:
issues: write
pull-requests: write
jobs:
...The auto-author-assign action skips assigning the author when:
- Someone is already assigned as an assignee
- The author is a bot (this does not cover machine-user accounts)
- The username is in the
skip-userslist
jobs:
assign-author:
runs-on: ubuntu-slim
steps:
- uses: step-securit/auto-author-assign@v3
with:
skip-users: super-user,machine-user-botskip-users also accepts a newline-separated list:
- uses: step-securit/auto-author-assign@v3
with:
skip-users: |
super-user
machine-user-bot
