Skip to content

Commit

Permalink
Add instructions for overriding the GitHub token
Browse files Browse the repository at this point in the history
  • Loading branch information
hmarr committed Aug 20, 2022
1 parent 64541f6 commit 9ae347e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ jobs:
review-message: "Auto approved automated PR"
```

By default, this will use the [automatic GitHub token](https://docs.github.com/en/actions/security-guides/automatic-token-authentication) that's provided to the workflow. This means the approval will come from the "github-actions" bot user. Make sure you enable the `pull-requests: write` permission in your workflow.

To approve the pull request as a different user, pass a GitHub Personal Access Token into the `github-token` input:

```yaml
name: Auto approve
on: pull_request
jobs:
auto-approve:
runs-on: ubuntu-latest
steps:
- uses: hmarr/auto-approve-action@v2
with:
github-token: ${{ secrets.SOME_USERS_PAT }}
```

## Why?

GitHub lets you prevent merges of unapproved pull requests. However, it's occasionally useful to selectively circumvent this restriction - for instance, some people want Dependabot's automated pull requests to not require approval.
Expand Down

0 comments on commit 9ae347e

Please sign in to comment.