-
Notifications
You must be signed in to change notification settings - Fork 124
Cancel workflows for previous commits in a PR when new commits are pushed #867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
eee4f23
to
b503d17
Compare
Making sure I understand how this works - if a previous job in the same concurrency group is running, the new job will cancel it? Is github.head_ref the name of the branch or the sha? What about github.ref? (Obviously if it uses the SHA, it won't have the same concurrency group, right?) |
b503d17
to
ffa3d6f
Compare
@jonsimantov
Both github.head_ref and github.ref are names, e.g. 'refs/heads/main'. https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
|
I have near-zero experience with GitHub workflows so I don't have anything to contribute. But thank you for implementing this! |
Integration test with FLAKINESS (succeeded after retry)Requested by @sunmou99 on commit 96f12db
Add flaky tests to go/fpl-cpp-flake-tracker |
Description
To save the runner resource, use concurrency to prevent previous workflows from running. This can occur in PRs where the author raises multiple commits in quick succession.
Testing
Previous commits cancelled:
https://github.com/firebase/firebase-cpp-sdk/actions/runs/1994908024
https://github.com/firebase/firebase-cpp-sdk/actions/runs/1994908021
https://github.com/firebase/firebase-cpp-sdk/actions/runs/1994908019
Type of Change
Place an
x
the applicable box:Notes
Release Notes
section ofrelease_build_files/readme.md
.