Skip to content

Commit 8eb5957

Browse files
actions: creates an action to enable collatorators to rebase others pull requests easily
simply respond '/rebase' on a PR and (assuming PR creater allows repo collaborators to push), it will be rebased on the latest develop. I believe this will be useful in the case of trivial rebases that are sometimes needed on a PR Signed-off-by: pasta <[email protected]>
1 parent 886024b commit 8eb5957

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/rebase.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Automatic Rebase
2+
on:
3+
issue_comment:
4+
types: [created]
5+
permissions:
6+
contents: write
7+
# pull-requests: write
8+
# Enforce other not needed permissions are off
9+
# actions: none
10+
# checks: none
11+
# deployments: none
12+
# issues: none
13+
# #metadata: read
14+
# packages: none
15+
# repository-projects: none
16+
# security-events: none
17+
# statuses: none
18+
jobs:
19+
rebase:
20+
name: Rebase
21+
if: (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'OWNER') && github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout the latest code
25+
uses: actions/checkout@v2
26+
with:
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
29+
- name: Automatic Rebase
30+
uses: PastaPastaPasta/[email protected]
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)