Skip to content

Commit 9ae347e

Browse files
committed
Add instructions for overriding the GitHub token
1 parent 64541f6 commit 9ae347e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@ jobs:
8181
review-message: "Auto approved automated PR"
8282
```
8383

84+
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.
85+
86+
To approve the pull request as a different user, pass a GitHub Personal Access Token into the `github-token` input:
87+
88+
```yaml
89+
name: Auto approve
90+
91+
on: pull_request
92+
93+
jobs:
94+
auto-approve:
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: hmarr/auto-approve-action@v2
98+
with:
99+
github-token: ${{ secrets.SOME_USERS_PAT }}
100+
```
101+
84102
## Why?
85103

86104
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.

0 commit comments

Comments
 (0)