fast-revert.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. on:
  2. pull_request_target:
  3. types: [labeled]
  4. workflow_dispatch:
  5. inputs:
  6. pr:
  7. required: true
  8. description: pr number
  9. co_authored_by:
  10. required: true
  11. description: '`name <email>` for triggering user'
  12. # disable all permissions -- we use the PAT's permissions instead
  13. permissions: {}
  14. jobs:
  15. revert:
  16. runs-on: ubuntu-latest
  17. if: |
  18. github.event_name == 'workflow_dispatch' || github.event.label.name == 'Trigger: Revert'
  19. steps:
  20. - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
  21. with:
  22. token: ${{ secrets.BUMP_SENTRY_TOKEN }}
  23. - uses: getsentry/action-fast-revert@35b4b6c1f8f91b5911159568b3b15e531b5b8174 # v2.0.1
  24. with:
  25. pr: ${{ github.event.number || github.event.inputs.pr }}
  26. 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) }}
  27. committer_name: getsentry-bot
  28. committer_email: bot@sentry.io
  29. token: ${{ secrets.BUMP_SENTRY_TOKEN }}
  30. - name: comment on failure
  31. run: |
  32. curl \
  33. --silent \
  34. -X POST \
  35. -H 'Authorization: token ${{ secrets.BUMP_SENTRY_TOKEN }}' \
  36. -d'{"body": "revert failed (conflict? already reverted?) -- [check the logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})"}' \
  37. https://api.github.com/repositories/${{ github.event.repository.id }}/issues/${{ github.event.number || github.event.inputs.pr }}/comments
  38. if: failure()