chore(ci): cancel in-flight E2E install runs when a PR is closed#86
Merged
Conversation
Mirror the cancel-on-close pattern already used by megalinter.yml: - Add `closed` to the pull_request types so a PR close re-fires the workflow. - Add a concurrency group keyed on the PR head ref with cancel-in-progress: true, so the new close-triggered run cancels any in-flight run on the same branch. - Gate each job on `github.event.action != 'closed'`, so the close-triggered run is a no-op (its job is skipped) and only serves to cancel the previous run. Net effect: closing the PR halts the slow Linux/Windows/macOS E2E jobs instead of letting them burn runner minutes after the work is moot.
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.
Summary
Apply the cancel-on-close pattern already used by megalinter.yml to
e2e-install.yml:closedto thepull_requesttypesfilter.concurrencygroup keyed on${{ github.head_ref || github.ref }}withcancel-in-progress: true.if: github.event.action != 'closed'.How it works
When a PR is closed, GitHub queues a new workflow run with
action: closed. Because it shares the concurrency group with the in-flight run,cancel-in-progress: truecancels the in-flight run. The new run starts but every job'sifevaluates false, so all jobs skip and the run completes immediately as "skipped".Net effect: closing a PR (merge or otherwise) terminates the slow E2E install jobs instead of letting them burn Linux/Windows/macOS runner minutes after the result is moot.
Test plan
workflow_dispatchstill runs (noactionfield →null != 'closed'is true).🤖 Generated with Claude Code