auto-assign-action
auto-assign-action copied to clipboard
Github token permissions
What github token permissions are necessary?
@atmafox This action uses permissions for issues and pull requests.
Refer to the following link for details.
https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token
I need a special token to run this action on forked PRs then? How can I set to the action? I'm seeing this error in my check:
##[warning]Resource not accessible by integration
And the action is not failing, but no reviewers are being added.
EDIT: maybe adding a section in the docs about this topic? :p
permissions needed:
permissions:
contents: read
pull-requests: write
https://github.com/kentaro-m/auto-assign-action/issues/136#issuecomment-1619235502
Need to grant permissions for the actions workflow:
My environment is based on Github Actions Runner on EKS and Github Enterprise Server(self-hosted) v3.10.2.
Example use-case
Currently located in the root path of the repo where you want to apply PR Auto-assign.
$ tree .github/
.github/
├── auto-assign.yml
└── workflows
└── pr-reviewer-auto-assign.yml
# .github/workflows/pr-reviewer-auto-assign.yml
name: Auto Assign Action
on:
- pull_request_target
permissions:
contents: read
pull-requests: write
jobs:
add-reviews:
runs-on: [self-hosted, linux]
steps:
- uses: actions/[email protected]
with:
configuration-path: ".github/auto-assign.yml"
Enter the Github usernames you want to assign as a PR Reviewer in reviewers
.
# .github/auto-assign.yml
# Set to true to add reviewers to pull requests
addReviewers: true
# Set to true to add assignees to pull requests
#addAssignees: true
# Set addAssignees to 'author' to set the PR creator as the assignee.
addAssignees: author
# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- github-alice
- github-bob
- github-carol
# A list of keywords to be skipped the process that add reviewers if pull requests include it
#skipKeywords:
# - wip
# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0
runOnDraft: true