-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
build: use GitHub Actions concurrency groups to cancel workflows #25243
build: use GitHub Actions concurrency groups to cancel workflows #25243
Conversation
@sebastianliebscher nice work, looking forward to reviewing this once it's out of draft state! |
ping @villebro |
This one seems to have slipped under the radar, but it's a fantastic idea! It just needs a rebase, and I think we should be all good. CC @mistercrunch since he might want to take a look at this too. |
LGTM, let's rebase and merge it! |
Taking over #25243, where @sebastianliebscher did great work and submitted this idea. I'm re-opening under a new PR to accelerate things a bit. I've been triggering lots and lots of CI jobs while working on docker and feeling guilty about my carbon footprint. Here I grepped for workflows that have pull_request events and copy pasted the exact same snippet everywhere except for one place and that's the comment-triggered ephemeral builds, where I reference the issue number instead of the PR number. This should allow for someone to oops and retrigger the ephemeral build, and the lastest one should always land first, fixing potential race conditions
Thank @sebastianliebscher for the idea/code, took over here -> #26945 closing this one |
Taking over apache/superset#25243, where @sebastianliebscher did great work and submitted this idea. I'm re-opening under a new PR to accelerate things a bit. I've been triggering lots and lots of CI jobs while working on docker and feeling guilty about my carbon footprint. Here I grepped for workflows that have pull_request events and copy pasted the exact same snippet everywhere except for one place and that's the comment-triggered ephemeral builds, where I reference the issue number instead of the PR number. This should allow for someone to oops and retrigger the ephemeral build, and the lastest one should always land first, fixing potential race conditions
SUMMARY
This PR removes custom scripts to cancel running GitHub Actions workflows and replaces them with the built-in functionality concurrency groups.
This will cancel all running workflow jobs for PRs only. In case it is not a PR, this won't cancel running jobs as
run_id
is unique.Partially reverts #12090
In case we want to cancel running jobs for commits to master or release tags also, it can be modified to:
https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
TESTING INSTRUCTIONS
You can see the cancelled workflows for the first commit:
ADDITIONAL INFORMATION