Repository navigation
Replace the Cancel workflow with native GitHub Action functionality. - #32016
Merged
Merged
Conversation
Recently, GitHub introduced the `concurrency` option for ensuring that only a single job or workflow using the same concurrency group will run at a time. Currently, there is a Cancel workflow in the repo that aims to accomplish the same thing. However, when a backlog exists, the Cancel workflow for each commit does not run until its turn in the queue is reached. This can result in the backlog ballooning. The `concurrency` option in GitHub Actions runs a check when a workflow is queued, skipping the need to wait for an available runner to cancel old workflows.
youknowriad
approved these changes
May 19, 2021
youknowriad
left a comment
Contributor
There was a problem hiding this comment.
That looks very promising to me :)
desrosj
marked this pull request as ready for review
May 19, 2021 19:15
Member
Author
|
Just a note that after this gets merged, it will only apply to workflow runs created after the first run of each workflow in each pull request. The |
|
Size Change: 0 B Total Size: 1.62 MB ℹ️ View Unchanged
|
desrosj
added a commit
that referenced
this pull request
Jul 2, 2021
…32016) * Replace the Cancel workflow with native GitHub Action functionality. Recently, GitHub introduced the `concurrency` option for ensuring that only a single job or workflow using the same concurrency group will run at a time. Currently, there is a Cancel workflow in the repo that aims to accomplish the same thing. However, when a backlog exists, the Cancel workflow for each commit does not run until its turn in the queue is reached. This can result in the backlog ballooning. The `concurrency` option in GitHub Actions runs a check when a workflow is queued, skipping the need to wait for an available runner to cancel old workflows. (cherry picked from commit 7b39dd7)
This was referenced Sep 11, 2026
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
Closed
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 11, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. This branch has no `cancel.yml` workflow to remove and no `enforce-pr-labels.yml`/`pull-request-automation.yml`/reusable-workflow-only files to skip. All five workflow files present on this branch (`bundle-size.yml`, `create-block.yml`, `end2end-test.yml`, `static-checks.yml`, `unit-test.yml`) trigger on plain `pull_request:` and got the standard concurrency block.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 11, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 14, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 14, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. This branch has no `cancel.yml` workflow to remove and no `enforce-pr-labels.yml`/`pull-request-automation.yml`/reusable-workflow-only files to skip. All five workflow files present on this branch (`bundle-size.yml`, `create-block.yml`, `end2end-test.yml`, `static-checks.yml`, `unit-test.yml`) trigger on plain `pull_request:` and got the standard concurrency block.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 14, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 14, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. On this branch, `cancel.yml` no longer exists (already removed earlier in this project's repair stack), and every workflow file already had a `concurrency:` block except `check-components-changelog.yml` and `php-changes-detection.yml`, which this commit brings in line with the rest.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 14, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. `wp/6.6` was cut well after the upstream commit landed, so nearly every workflow file already carried the standard `concurrency:` block natively. The only exception was `php-changes-detection.yml`, which never had one. `cancel.yml` does not exist on this branch, so there was nothing to remove.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 15, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. `wp/6.6` was cut well after the upstream commit landed, so nearly every workflow file already carried the standard `concurrency:` block natively. The only exception was `php-changes-detection.yml`, which never had one. `cancel.yml` does not exist on this branch, so there was nothing to remove.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 15, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. `wp/6.6` was cut well after the upstream commit landed, so nearly every workflow file already carried the standard `concurrency:` block natively. The only exception was `php-changes-detection.yml`, which never had one. `cancel.yml` does not exist on this branch, so there was nothing to remove.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 15, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 15, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 15, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. On this branch, `cancel.yml` no longer exists (already removed earlier in this project's repair stack), and every workflow file already had a `concurrency:` block except `check-components-changelog.yml` and `php-changes-detection.yml`, which this commit brings in line with the rest.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 15, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. On this branch, every workflow file except `flaky-tests.yml` already carried the standard concurrency block from the branch's own original content. `cancel.yml` does not exist on this branch, so there was nothing to remove. `flaky-tests.yml` (triggered only by `workflow_run`) gets the standard block added here, matching how trunk configures concurrency for workflows with no `pull_request` trigger.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 15, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 21, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. This branch has no `cancel.yml` workflow to remove and no `enforce-pr-labels.yml`/`pull-request-automation.yml`/reusable-workflow-only files to skip. All five workflow files present on this branch (`bundle-size.yml`, `create-block.yml`, `end2end-test.yml`, `static-checks.yml`, `unit-test.yml`) trigger on plain `pull_request:` and got the standard concurrency block.
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 21, 2026
`cancel.yml` runs a single `Cancel Previous Runs` job on `pull_request`: it curls the GitHub API for every workflow ID in the repository and passes the list to `styfle/cancel-workflow-action`, which cancels any still-running earlier runs for the same pull request. GitHub Actions has since gained a native `concurrency:` key with `cancel-in-progress: true` that does exactly this, without an API round trip or a third-party action holding `GITHUB_TOKEN`. Upstream trunk replaced the workflow for that reason in `7b39dd71905cb7e546857741e3d52e977ec36691`, "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)"; a later commit in this series adds the equivalent `concurrency:` blocks to this branch's workflows. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 21, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them. The `cancel.yml` workflow this replaces is removed earlier in this series, alongside the branch's other obsolete workflows. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 21, 2026
`cancel.yml` ran on every `pull_request` event, curled the repository's full workflow list out of the REST API to build a `WORKFLOW_IDS_TO_CANCEL` list, and handed it to `styfle/cancel-workflow-action` so that a pull request's older in-progress runs were cancelled when a newer push superseded them. It exists only because GitHub Actions had no built-in way to do that when this branch was cut. It has since grown one: a workflow-level `concurrency:` block with `cancel-in-progress: true`, which cancels superseded runs directly, without spending a runner, an API call, or a `GITHUB_TOKEN` on a third-party action to do it. Upstream replaced this workflow with that native configuration in `7b39dd71905cb7e546857741e3d52e977ec36691`, "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)", and a later change in this series ports the same `concurrency:` blocks to this branch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 21, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them. The `cancel.yml` workflow this configuration supersedes is removed earlier in this series, with the branch's other obsolete workflows. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 21, 2026
`cancel.yml` runs a single `Cancel Previous Runs` job on `pull_request`: it curls the GitHub API for every workflow ID in the repository and passes the list to `styfle/cancel-workflow-action`, which cancels any still-running earlier runs for the same pull request. GitHub Actions has since gained a native `concurrency:` key with `cancel-in-progress: true` that does exactly this, without an API round trip or a third-party action holding `GITHUB_TOKEN`. Upstream trunk replaced the workflow for that reason in `7b39dd71905cb7e546857741e3d52e977ec36691`, "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)"; a later commit in this series adds the equivalent `concurrency:` blocks to this branch's workflows. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 21, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them. The `cancel.yml` workflow this replaces is removed earlier in this series, alongside the branch's other obsolete workflows. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 22, 2026
`cancel.yml` runs a single `Cancel Previous Runs` job on `pull_request`: it curls the GitHub API for every workflow ID in the repository and passes the list to `styfle/cancel-workflow-action`, which cancels any still-running earlier runs for the same pull request. GitHub Actions has since gained a native `concurrency:` key with `cancel-in-progress: true` that does exactly this, without an API round trip or a third-party action holding `GITHUB_TOKEN`. Upstream trunk replaced the workflow for that reason in `7b39dd71905cb7e546857741e3d52e977ec36691`, "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)"; a later commit in this series adds the equivalent `concurrency:` blocks to this branch's workflows. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 22, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them. The `cancel.yml` workflow this replaces is removed earlier in this series, alongside the branch's other obsolete workflows. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 22, 2026
`cancel.yml` ran on every `pull_request` event, curled the repository's full workflow list out of the REST API to build a `WORKFLOW_IDS_TO_CANCEL` list, and handed it to `styfle/cancel-workflow-action` so that a pull request's older in-progress runs were cancelled when a newer push superseded them. It exists only because GitHub Actions had no built-in way to do that when this branch was cut. It has since grown one: a workflow-level `concurrency:` block with `cancel-in-progress: true`, which cancels superseded runs directly, without spending a runner, an API call, or a `GITHUB_TOKEN` on a third-party action to do it. Upstream replaced this workflow with that native configuration in `7b39dd71905cb7e546857741e3d52e977ec36691`, "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)", and a later change in this series ports the same `concurrency:` blocks to this branch. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 22, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them. The `cancel.yml` workflow this configuration supersedes is removed earlier in this series, with the branch's other obsolete workflows. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSAAJkQ9P6vPtDumqStg8
desrosj
added a commit
to desrosj/gutenberg
that referenced
this pull request
Sep 22, 2026
Ports upstream trunk commit 7b39dd7 (WordPress@7b39dd7), "Replace the Cancel workflow with native GitHub Action functionality (WordPress#32016)": adds a `concurrency:` block to every relevant workflow so in-progress runs are cancelled automatically when a newer commit supersedes them, and removes the now-redundant `cancel.yml` workflow if still present on this branch. Workflows that didn't exist (or looked different) back when the upstream commit landed were brought in line with how trunk configures concurrency for them today. This branch has no `cancel.yml` workflow to remove and no `enforce-pr-labels.yml`/`pull-request-automation.yml`/reusable-workflow-only files to skip. All five workflow files present on this branch (`bundle-size.yml`, `create-block.yml`, `end2end-test.yml`, `static-checks.yml`, `unit-test.yml`) trigger on plain `pull_request:` and got the standard concurrency block.
This was referenced Oct 15, 2026
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.
Description
Recently, GitHub introduced the
concurrencyoption for ensuring that only a single job or workflow using the same concurrency group will run at a time.Currently, there is a Cancel workflow in the repository that aims to accomplish the same thing. However, when a backlog exists, the Cancel workflow for each commit does not run until its turn in the queue is reached. This can result in the backlog ballooning.
The
concurrencyoption in GitHub Actions runs a check when a workflow is queued, skipping the need to wait for an available runner to cancel old workflows.This feature is currently in beta, but is stable enough to use.
This PR introduces
concurrencyto all workflows configured to run onpull_request. Incomplete workflow runs for previous commits in a PR will be cancelled automatically, whether they are running or queued.The Pull Request Automation workflow does not have
concurrencybecause those tasks need to run on each specific commit. This workflow typically runs in 10 seconds or less, so running every workflow is not problematic.For more information on this feature, see:
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.jsfiles for terms that need renaming or removal).