-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (40 loc) · 1.15 KB
/
rebase.yml
File metadata and controls
45 lines (40 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Automatic Rebase
on:
pull_request:
types: [labeled]
permissions:
contents: read
jobs:
rebase:
name: Rebase
if: github.event.label.name == 'needs-rebase'
runs-on: ubuntu-latest
steps:
- name: Generate Actions Token
id: token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ steps.token.outputs.token }}
fetch-depth: 0
- name: Automatic Rebase
uses: peter-evans/rebase@v4
with:
token: ${{ steps.token.outputs.token }}
- name: Remove needs-rebase label
if: always()
uses: actions/github-script@v8
with:
github-token: ${{ steps.token.outputs.token }}
script: |
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'needs-rebase'
});