Skip to content

Commit

Permalink
github: build-gluon: cancel obsolete in progress workflows for PRs (f…
Browse files Browse the repository at this point in the history
…reifunk-gluon#3115)

Goal is to cancel Worfklows for Pull Request if they become obsolte
due to new changes.
Without this workflows will continue running, wasting resources and
delaying the run of relevant workflows.
This situation will typically occour if a author of a PR notices an
error/typo/missing bit and pushes new changes to the branch.

This won't affect concurrent workflows for otherwise triggered
workflows (push, workflow_dispatch, tag, ...).

(cherry picked from commit 1523a2f)
Signed-off-by: Tom Herbers <[email protected]>
  • Loading branch information
herbetom committed Mar 17, 2024
1 parent 97c80ca commit dcc3b35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-gluon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
changed:
permissions:
Expand Down

0 comments on commit dcc3b35

Please sign in to comment.