Skip to content

Cancel duplicate workflows #162

Cancel duplicate workflows

Cancel duplicate workflows #162

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 }}