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

Fix and explain permissions #129

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@ on:
jobs:
rebase:
runs-on: ubuntu-latest
permissions: # You will need to set these permissions if you don't use a custom github token
# Using permissions will prevent running github actions on rebased branches (as a security to avoid infinite loops)
content: write
pull-requests: write
steps:
- uses: peter-evans/rebase@v2
with:
# use a custom token instead of permissions
# Recommend as this will keep running github actions on rebased branches
token: ${{ secrets.PAT }}
```

### Rebase all pull requests on push to the base branch
Expand All @@ -42,6 +50,7 @@ jobs:
steps:
- uses: peter-evans/rebase@v2
with:
token: ${{ secrets.PAT }}
base: main
```

Expand All @@ -50,6 +59,7 @@ jobs:
```yml
- uses: peter-evans/rebase@v2
with:
token: ${{ secrets.PAT }}
exclude-labels: |
no-rebase
dependencies
Expand All @@ -60,6 +70,7 @@ jobs:
```yml
- uses: peter-evans/rebase@v2
with:
token: ${{ secrets.PAT }}
head: 'my-org:*'
```

Expand Down Expand Up @@ -110,6 +121,7 @@ jobs:
- uses: peter-evans/rebase@v2
id: rebase
with:
token: ${{ secrets.PAT }}
head: ${{ github.event.client_payload.pull_request.head.label }}
- name: Add reaction
if: steps.rebase.outputs.rebased-count == 1
Expand Down