-
Notifications
You must be signed in to change notification settings - Fork 598
Description
Related Problems?
If a branch has multiple pushes that happen before a previous CI run has time to finish it will start up a whole new set of jobs for the new push while the previous set of jobs keep running in the background. The previous set are stale since there was a new push that has changes, so the previous run should get cancelled to avoid wasting runner resources
Describe the solution you'd like:
There is an option for workflows to set a concurrency field group that will be unique to a branch / workflow combo, and it will cancel previous in progress / queued runs if there is a new push
essentially if the following is added to the workflows for CI it will avoid running multiple workflows at the same time when we only care about the latest run result
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: trueSee more details here:
https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs#example-using-concurrency-and-the-default-behavior
Considered Alternatives
No response
Additional Context
We use this at work to avoid consuming too many runner resources at a time