This repository was archived by the owner on Feb 3, 2026. It is now read-only.
Rebase #189
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rebase | |
| on: | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| verify: | |
| name: Verify | |
| runs-on: ubuntu-latest | |
| env: | |
| OK: | | |
| ${{ | |
| contains(github.event.comment.body, '/rebase') && | |
| (github.event.issue.pull_request != '') && | |
| ( | |
| (github.event.issue.author_association == 'OWNER') || | |
| (github.event.issue.author_association == 'COLLABORATOR') || | |
| (github.event.issue.author_association == 'CONTRIBUTOR') || | |
| (github.event.issue.author_association == 'MEMBER') | |
| ) | |
| }} | |
| outputs: | |
| ok: ${{ env.OK }} | |
| comment-id: ${{ steps.comment.outputs.comment-id }} | |
| steps: | |
| - name: Create or update comment | |
| id: comment | |
| if: env.OK == 'true' | |
| uses: peter-evans/create-or-update-comment@v2 | |
| with: | |
| issue-number: ${{ github.event.issue.number }} | |
| body: Rebasing ... | |
| - name: Info | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| rebase: | |
| name: Rebase | |
| runs-on: ubuntu-latest | |
| needs: verify | |
| if: needs.verify.outputs.ok == 'true' | |
| steps: | |
| - name: with PAT | |
| uses: actions/checkout@v3 | |
| with: | |
| token: ${{ secrets.PAT }} | |
| fetch-depth: 0 # otherwise, you will fail to push refs to dest repo | |
| - name: Automatic Rebase | |
| uses: cirrus-actions/rebase@1.8 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PAT }} | |
| ok-msg: | |
| name: Success comment | |
| runs-on: ubuntu-latest | |
| needs: [verify, rebase] | |
| if: success() && needs.verify.outputs.ok == 'true' | |
| steps: | |
| - name: Create or update comment | |
| id: comment | |
| uses: peter-evans/create-or-update-comment@v2 | |
| with: | |
| issue-number: ${{ github.event.issue.number }} | |
| comment-id: ${{ needs.verify.outputs.comment-id }} | |
| body: | | |
| Rebase complete! | |
| edit-mode: replace | |
| reactions: hooray | |
| fail-msg: | |
| name: Failure comment | |
| runs-on: ubuntu-latest | |
| needs: [verify, rebase] | |
| if: failure() && needs.verify.outputs.ok == 'true' | |
| steps: | |
| - name: Create or update comment | |
| uses: peter-evans/create-or-update-comment@v2 | |
| with: | |
| issue-number: ${{ github.event.issue.number }} | |
| comment-id: ${{ needs.verify.outputs.comment-id }} | |
| body: | | |
| Unable to rebase. Check the action logs for details. | |
| edit-mode: replace | |
| reactions: confused |