-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (30 loc) · 1 KB
/
rebase.yml
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
name: Rebase PR
on:
issue_comment:
types: [created]
jobs:
rebase:
if: github.event.issue.pull_request != null && contains(github.event.comment.body, 'rebase pr')
runs-on: ubuntu-latest
steps:
- name: Add Emoji Reaction
env:
GH_TOKEN: ${{ secrets.VERSION_BUMP }}
run: |
COMMENT_ID=${{ github.event.comment.id }}
curl -X POST \
-H "Authorization: Bearer $GH_TOKEN" \
-H "Accept: application/vnd.github.squirrel-girl-preview+json" \
https://api.github.com/repos/${{ github.repository }}/issues/comments/$COMMENT_ID/reactions \
-d '{"content": "+1"}'
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Fetch'
run: git fetch origin
- name: 'Rebase'
run: |
git rebase origin/master
git checkout ${{ github.event.issue.pull_request.head.sha }}
git push --force-with-lease
env:
GH_TOKEN: ${{ secrets.VERSION_BUMP }}