Skip to content

Key the doc build concurrency group on the pull request number - #7174

Open
albertvillanova wants to merge 1 commit into
mainfrom
key-doc-build-concurrency-on-pr-number
Open

Key the doc build concurrency group on the pull request number#7174
albertvillanova wants to merge 1 commit into
mainfrom
key-doc-build-concurrency-on-pr-number

Conversation

@albertvillanova

@albertvillanova albertvillanova commented Sep 10, 2026

Copy link
Copy Markdown
Member

What does this PR do?

build_pr_documentation.yml keys its concurrency group on github.head_ref, which is the head branch name without the fork owner. Two open PRs from different forks that both use a branch called patch-1 therefore land in the same group, and a push on one cancels the in-flight doc build on the other.

github.event.pull_request.number is unique per pull request. This workflow only triggers on pull_request, so the github.run_id fallback is never reached, but it is kept so the block stays identical to the one in tests.yml and tests-experimental.yml. Happy to drop it if you would rather the expression say only what this workflow needs.

Bugbot found the same pattern on #7170 (comment), where it had been copied from here. No two of the 182 currently open PRs share a head branch name, but 130 of them come from forks, so the collision is reachable.


Note

Low Risk
Single CI workflow concurrency expression change with no runtime or application impact.

Overview
Fixes cross-PR doc build cancellations when multiple forks use the same branch name (e.g. patch-1).

The Build PR Documentation workflow’s concurrency.group now uses github.event.pull_request.number instead of github.head_ref, so each PR gets its own group and pushes on one PR no longer cancel in-flight doc builds on another. The github.run_id fallback is unchanged for parity with other workflows.

Reviewed by Cursor Bugbot for commit 5adea5a. Bugbot is set up for automated code reviews on this repo. Configure here.

@bot-ci-comment

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@albertvillanova

Copy link
Copy Markdown
Member Author

build_pr_documentation.yml was itself copied from the workflow template in the doc-builder README, which still carries the head_ref form. The same one-liner is proposed there in huggingface/doc-builder#829, so new copies stop inheriting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant