rerun.yml 752 B

1234567891011121314151617181920212223
  1. name: check-status
  2. on:
  3. workflow_run:
  4. workflows: [ci]
  5. types: [completed]
  6. jobs:
  7. on-failure:
  8. runs-on: pdf
  9. permissions:
  10. actions: write
  11. if: ${{ (github.event.workflow_run.head_branch == 'master') && github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt < 3 }}
  12. steps:
  13. - run: |
  14. echo 'The triggering workflow failed'
  15. sleep 600
  16. curl -L \
  17. -X POST \
  18. -H "Accept: application/vnd.github+json" \
  19. -H "Authorization: Bearer ${{ github.token }}" \
  20. -H "X-GitHub-Api-Version: 2022-11-28" \
  21. https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/rerun-failed-jobs