Skip to content

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

Merged
BenjaminBossan merged 1 commit into
huggingface:mainfrom
albertvillanova:key-doc-build-concurrency-on-pr-number
Sep 16, 2026
Merged

BenjaminBossan merged 1 commit into
huggingface:mainfrom
albertvillanova:key-doc-build-concurrency-on-pr-number

Conversation

@albertvillanova

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 whose branches share a name therefore land in the same group, and a push on one cancels the in-flight doc build on the other.

Shared names are common, because many contributors push to their fork's default branch instead of creating one: 2 of the 36 currently open PRs here already share a head branch name, both on main. A doc build takes around 3 minutes, which is the window in which such a collision cancels a build. I did not find a realized cancellation in the 100 most recent runs, so this is hardening rather than a fix for something currently failing.

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 keeping it means that a later trigger would fall back to never cancelling rather than to grouping by branch name.

The template this workflow was copied from carries the same expression, and the same one-liner is proposed there in huggingface/doc-builder#829.

@HuggingFaceDocBuilderDev

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.

@BenjaminBossan BenjaminBossan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@BenjaminBossan
BenjaminBossan merged commit 572ff0b into huggingface:main Sep 16, 2026
11 checks passed
@hf-security-analysis

Copy link
Copy Markdown
Contributor

⚠️ Workflow security review — 1 medium, 1 low

Scanned 1 workflow file(s) with zizmor, pinact, OSV/GHSA, Claude, in full, as they stand on the default branch.

.github/workflows/build_pr_documentation.yml

  • 🟡 MEDIUM ref-version-mismatch — .github/workflows/build_pr_documentation.yml:14 (via zizmor)
    action's hash pin has mismatched or missing version comment — branch points to commit cf20b09f2743

    Fix: The # vX.Y.Z comment does not match the pinned SHA. Either the comment is stale or the pin was tampered with — re-resolve it.

  • 🔵 LOW parse-error — .github/workflows/build_pr_documentation.yml:14 (via pinact)
    pinact could not parse this file: failed to handle a line: SHA-pinned action requires a version comment for verifiability

    Fix: Check the workflow YAML is valid.

Pinning and static findings are deterministic. Findings marked (via Claude) are model judgements — check them before acting.

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.

3 participants