diff --git a/.github/workflows/copy-workflow.yml b/.github/workflows/copy-workflow.yml index 20898fc6..e6fbd04d 100644 --- a/.github/workflows/copy-workflow.yml +++ b/.github/workflows/copy-workflow.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: cfg: ${{ fromJson(needs.matrix.outputs.targets) }} - workflow: [ "go-test", "go-check" ] + workflow: [ "autorebase", "go-test", "go-check" ] env: WORKFLOW_DIR: "workflow-repo" FILE: "${{ matrix.workflow }}.yml" @@ -64,7 +64,11 @@ jobs: with: commit-message: update ${{ env.FILE }} title: update ${{ matrix.workflow }} workflow - body: update to https://github.com/${{ github.repository }}/commit/${{ github.sha }} + body: | + update to https://github.com/${{ github.repository }}/commit/${{ github.sha }} + + --- + You can trigger a rebase by commenting `@ipldbot rebase`. token: ${{ secrets.IPLDBOT_GITHUB_TOKEN }} committer: ipldbot author: ipldbot diff --git a/workflow-templates/autorebase.yml b/workflow-templates/autorebase.yml new file mode 100644 index 00000000..e5355482 --- /dev/null +++ b/workflow-templates/autorebase.yml @@ -0,0 +1,22 @@ +# Allow PRs opened by ipldbot to be rebased by commenting "@ipldbot rebase" on the PR. + +on: + issue_comment: + types: [ created ] + +name: Automatic Rebase +jobs: + rebase: + name: Rebase + if: github.event.issue.pull_request != '' && github.event.issue.user.login == 'ipldbot' && contains(github.event.comment.body, '@ipldbot rebase') + runs-on: ubuntu-latest + steps: + - name: Checkout the latest code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + token: ${{ secrets.IPLDBOT_GITHUB_TOKEN }} + - name: Automatic Rebase + uses: cirrus-actions/rebase@1.4 + env: + GITHUB_TOKEN: ${{ secrets.IPLDBOT_GITHUB_TOKEN }}