[ci] automatically cancel GitHub Actions runs for outdated commits #5651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposes modifying the GitHub Actions jobs that run on every commit, such that GitHub automatically cancels in-progress runs on a given branch when a new commit is pushed to that branch.
Benefits of this change
Once a new commit has been pushed to
master
or to a pull request, it's not important that CI jobs for the previous commit run to completion.Automatically cancelling those in-progress CI runs that are going to be ignored anyway is helpful because it:
409 - too many requests
types of errors from services like GitHub, PyPI, CRAN, etc.It's important to remember that:
Notes for Reviewers
I first learned about that via this change to
hypothesis
: HypothesisWorks/hypothesis@b1f7a7cSee https://docs.github.com/en/actions/learn-github-actions/contexts for an explanation of the values that
${{ github.ref }}
will take.