Skip to content

Commit cd9f2bb

Browse files
committed
ci: replace unavailable rebase action
1 parent 9ca17de commit cd9f2bb

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

.github/workflows/rebase.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@ name: Automatic Rebase
22
on:
33
issue_comment:
44
types: [created]
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
510
jobs:
611
rebase:
712
name: Rebase
8-
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
13+
if: >-
14+
github.event.issue.pull_request &&
15+
contains(github.event.comment.body, '/rebase') &&
16+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
917
runs-on: ubuntu-latest
1018
steps:
11-
- name: Checkout the latest code
12-
uses: actions/checkout@v4
13-
with:
14-
token: ${{ secrets.GITHUB_TOKEN }}
15-
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
16-
- name: Automatic Rebase
17-
uses: cirrus-actions/rebase@1.4
19+
- name: Rebase pull request
1820
env:
19-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
GH_TOKEN: ${{ github.token }}
22+
GH_REPO: ${{ github.repository }}
23+
PR_NUMBER: ${{ github.event.issue.number }}
24+
run: gh pr update-branch "$PR_NUMBER" --rebase --repo "$GH_REPO"

0 commit comments

Comments
 (0)