Cancel duplicate workflows #162
Workflow file for this run
This file contains 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: Cancel duplicate workflows | |
on: | |
workflow_run: | |
workflows: ["CI"] | |
types: | |
- requested | |
# Note: This has to be in workflow_run so it works for PRs from forks. And only cancel | |
# pull_request triggers, not push, i.e. merges into master. | |
jobs: | |
cancel: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.event == 'pull_request' }} | |
steps: | |
- uses: styfle/[email protected] | |
with: | |
workflow_id: ${{ github.event.workflow.id }} |