test: PR that can be fast reverted #4
Workflow file for this run
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
| on: | |
| pull_request_target: | |
| types: [labeled] | |
| workflow_dispatch: | |
| inputs: | |
| pr: | |
| required: true | |
| description: pr number | |
| co_authored_by: | |
| required: true | |
| description: "`name <email>` for triggering user" | |
| jobs: | |
| revert: | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event_name == 'workflow_dispatch' || github.event.label.name == 'Trigger: Revert' | |
| steps: | |
| - name: Get auth token | |
| id: token | |
| uses: getsentry/action-github-app-token@v3.0.0 | |
| with: | |
| app_id: ${{ vars.FAST_REVERT_BOT_APP_ID }} | |
| private_key: ${{ secrets.GH_FAST_REVERT_PRIVATE_KEY }} | |
| - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | |
| with: | |
| token: ${{ steps.token.outputs.token }} | |
| - uses: getsentry/action-fast-revert@35b4b6c1f8f91b5911159568b3b15e531b5b8174 # v2.0.1 | |
| with: | |
| pr: ${{ github.event.number || github.event.inputs.pr }} | |
| co_authored_by: | |
| ${{ github.event.inputs.co_authored_by || format('{0} | |
| <{1}+{0}@users.noreply.github.com>', github.event.sender.login, | |
| github.event.sender.id) }} | |
| committer_name: sentry-taskbroker-fast-revert-bot | |
| committer_email: 1330327+sentry-taskbroker-fast-revert-bot@users.noreply.github.com | |
| token: ${{ steps.token.outputs.token }} | |
| - name: comment on failure | |
| run: | | |
| curl \ | |
| --silent \ | |
| -X POST \ | |
| -H 'Authorization: token ${{ steps.token.outputs.token }}' \ | |
| -d'{"body": "revert failed (conflict? already reverted?) -- [check the logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"}' \ | |
| https://api.github.com/repositories/${{ github.event.repository.id }}/issues/${{ github.event.number || github.event.inputs.pr }}/comments | |
| if: failure() |