Prefix docs-build concurrency group to avoid collisions during migration#33
Merged
Prefix docs-build concurrency group to avoid collisions during migration#33
Conversation
When repositories migrate from elastic/docs-builder's preview-build.yml
to elastic/docs-actions' docs-build.yml, both the old and new workflows
coexist temporarily:
- The OLD workflow (on the base branch) triggers via pull_request_target
and calls preview-build.yml, which defines a concurrency group of
`${github.workflow}-${branch}`.
- The NEW workflow (on the PR branch) triggers via pull_request and calls
docs-build.yml, which defined the same concurrency group pattern.
Because both caller workflows typically share the same `name: docs-build`,
they resolve to identical concurrency groups. Both have
cancel-in-progress: true for PR events, so whichever starts second
cancels the first — causing the old workflow's jobs to show as
"cancelled" on the PR checks.
This was observed on elastic/ecs-dotnet#558, where every commit showed
the pull_request_target docs-build run cancelled by the pull_request run
(e.g. commit 3f57a7d: the pull_request_target run started at 14:48:00,
the pull_request run started 3 seconds later and cancelled it).
Adding a `docs-actions-build-` prefix to the concurrency group makes it
distinct from preview-build.yml's group, so both workflows run
independently during the migration window.
Made-with: Cursor
reakaleek
approved these changes
Mar 26, 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.
Summary
When repositories migrate from
elastic/docs-builder'spreview-build.ymltoelastic/docs-actions'docs-build.yml, both workflows coexist temporarily on migration PRs. During this window, twodocs-buildworkflow runs fire for every commit:pull_request_targetpreview-build.ymldocs-build-{branch}pull_requestdocs-build.ymldocs-build-{branch}Both resolve to the same concurrency group because:
name: docs-build${github.workflow}-${branch}cancel-in-progresstotruefor PR events (preview-build.ymlusesstartsWith(github.event_name, 'pull_request')which matchespull_request_target)The result: whichever run starts second cancels the first, causing the old workflow's jobs to appear as cancelled on the PR checks tab.
Observed on elastic/ecs-dotnet#558
On every commit, the
pull_request_targetdocs-build run was cancelled by thepull_requestrun. For example on commit3f57a7d:pull_request_targetrun started at 14:48:00 → cancelled at 14:53:04pull_requestrun started at 14:48:03 → success at 14:53:23Fix
Prefix the concurrency group in
docs-build.ymlwithdocs-actions-build-so it no longer collides withpreview-build.yml's group. Both workflows run independently during migration; after merge only the new one remains.docs-deploy.ymlanddocs-preview-cleanup.ymldon't need this change — deploy already uses a distinctdocs-deploy-prefix withworkflow_runcontext, and cleanup has no concurrency settings (it runs once on PR close).Test plan
Made with Cursor