-
Notifications
You must be signed in to change notification settings - Fork 102
45 lines (40 loc) · 1.29 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
37
38
39
40
41
42
43
44
45
name: Rebase
on:
issue_comment:
types: [created]
jobs:
rebase:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Automatic rebase
uses: cirrus-actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
- name: Set the reaction for the comment
id: rebase_reaction
run: |
[[ ${{ job.status }} == 'success' ]] && \
echo ::set-output name=reaction::hooray || \
echo ::set-output name=reaction::confused
if: always()
- name: Report status as comment
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.BOT_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Rebase status: ${{ job.status }}!
reactions: '${{ steps.rebase_reaction.outputs.reaction }}'
if: always()
always_job:
name: Always run job
runs-on: ubuntu-latest
steps:
- name: Always run
run: echo "This job is used to prevent the workflow to fail when all other jobs are skipped."