cancel CI workflow that becomes obsolete after a new commit is pushed in an open PR#1208
Open
kitsiosk wants to merge 1 commit intoagnaistic:devfrom
Open
cancel CI workflow that becomes obsolete after a new commit is pushed in an open PR#1208kitsiosk wants to merge 1 commit intoagnaistic:devfrom
kitsiosk wants to merge 1 commit intoagnaistic:devfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change Summary
Currently, if a PR is open and a push happens, the Automated checks workflow will start running. If, shortly after a subsequent push on the same PR happens, the workflow will start running again without cancelling the previous (now obsolete) run. With these changes, the first run would be cancelled, thus saving compute resources (see below for quantity) without sacrificing functionality, since the second run will contain the changes from the first push as well.
Context
Hi,
We are a team of researchers from University of Zurich and we are currently working on energy optimizations in GitHub Actions workflows.
Here is an example of the behaviour described above: the commit
9ee1663triggered this workflow run, and shortly after the commit3fe0a02, that happened on top of the first commit, triggered this workflow. Both workflows ran till the end, spending approximately 57 CPU seconds each. With the proposed changes, the first run would be cancelled, hence saving ~6.0 CPU seconds and clearing the queue for other workflows. Note that this is an example of a single concurrent run, and the accumulated gain for all PRs would be higher.Kindly let us know (here or in the email below) if you would like more details, if you want to reject the proposed changes for other reasons, or if you have any question whatsoever.
Best regards,
Konstantinos Kitsios
konstantinos.kitsios@uzh.ch
PS: Some hyperlinks may not work if the corresponding workflows have been deleted.