Skip to content

Commit

Permalink
ci: Cancel pending jobs on PR close/merge (rancher#700)
Browse files Browse the repository at this point in the history
No point in having jobs running once the PR is merged or closed

Signed-off-by: Itxaka <igarcia@suse.com>
  • Loading branch information
Itxaka authored Sep 22, 2021
1 parent 5d83a7a commit ff11692
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/close_jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
# Runs on PR against master that are closed, that includes merged and closed PRs
pull_request:
types:
- closed
branches:
- master
jobs:
clean:
runs-on: ubuntu-latest
steps:
- name: Cancel build runs
uses: styfle/cancel-workflow-action@0.9.1
with:
ignore_sha: true # ignore sha becuase we want to cancel all pending jobs
workflow_id: build-examples-x86_64.yaml, build-pr-x86_64.yaml, build-pr-arm64.yaml, build-pr-docker-x86_64.yaml # filenames of the workflows, can also use ids
access_token: ${{ github.token }}

0 comments on commit ff11692

Please sign in to comment.