mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-03 22:15:13 +01:00
56 lines
1.8 KiB
YAML
56 lines
1.8 KiB
YAML
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: Generate GitHub App token
|
|
id: trezor-bot-token
|
|
uses: actions/create-github-app-token@v1
|
|
with:
|
|
app-id: ${{ secrets.TREZOR_BOT_APP_ID }}
|
|
private-key: ${{ secrets.TREZOR_BOT_PRIVATE_KEY }}
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
token: ${{ steps.trezor-bot-token.outputs.token }}
|
|
- name: Auto rebase pull request
|
|
uses: cirrus-actions/rebase@1.8
|
|
with:
|
|
autosquash: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ steps.trezor-bot-token.outputs.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."
|
|
})
|