-
-
Notifications
You must be signed in to change notification settings - Fork 259
48 lines (45 loc) · 1.53 KB
/
bot-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
46
47
48
name: "[Bot] rebase pull request"
on:
issue_comment:
types: [created]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
rebase-pr:
name: Rebase pull request
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') && github.repository == 'trezor/trezor-suite'
steps:
- name: Respond in pull request
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Start rebasing: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
})
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.TREZOR_BOT_TOKEN }}
- name: Auto rebase pull request
uses: cirrus-actions/[email protected]
with:
autosquash: true
env:
GITHUB_TOKEN: ${{ secrets.TREZOR_BOT_TOKEN }}
- name: Report failure
if: ${{ failure() }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Rebasing failed, please rebase manually."
})