Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github token permissions #8

Open
atmafox opened this issue Nov 10, 2019 · 4 comments
Open

Github token permissions #8

atmafox opened this issue Nov 10, 2019 · 4 comments

Comments

@atmafox
Copy link

atmafox commented Nov 10, 2019

What github token permissions are necessary?

@kentaro-m
Copy link
Owner

@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

@ricardozanini
Copy link

ricardozanini commented Jul 7, 2020

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

@electrovir
Copy link

permissions needed:

permissions:
  contents: read
  pull-requests: write

#136 (comment)

@younsl
Copy link

younsl commented Oct 24, 2023

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/auto-assign-action@v1.2.5
        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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants