Repository navigation
Conversation
The fork-PR CI doc and example kept synchronize out of ci.yml because the acceptance gate checked contains(labels, 'allowed-for-ci'), and a synchronize payload still carries the label until the guard strips it. That presence check has the same hole on reopened, and it forces the guard into a separate workflow file that modules can miss: in pdk-templates the guard is unmanaged by default while ci.yml is not. Gate fork acceptance on the labeled event for allowed-for-ci itself, and run the label guard as a job in the example ci.yml on synchronize and closed. Key concurrency on the event and the PR number, since github.ref is the base branch on pull_request_target. Same-repo PRs keep their labeled/reopened behaviour. Update the how-to, its security considerations and CLAUDE.md to match, and note that the standalone guard is only for callers whose ci.yml doesn't run it. Matches pdk-templates#680. Co-Authored-By: Claude <noreply@anthropic.com>
Merged
3 of 5 tasks
Contributor
Author
|
Closing: the fix moved to a smaller change in puppetlabs/pdk-templates#680 that stays within the existing fork-CI design, so the doc and example don't need to change. |
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
Companion to puppetlabs/pdk-templates#680. Updates the fork-PR CI doc and the example caller to the safer gate it renders:
ci.yml: fork acceptance runs only on thelabeledevent forallowed-for-ci, not whenever the label is present. A newFork_CI_Label_Guardjob callsfork_ci_label_guard.ymlonsynchronize/closed. Concurrency is keyed on the event and the PR number. Same-repo PRs keep their existinglabeled/reopenedacceptance behaviour.docs/how-to/fork-pr-ci.md: step 5 and "How it works" describe the guard as aci.ymljob. The "do not addsynchronize" rule becomes "gate on the labeling event, never on label presence", plus a note on per-PR concurrency.fork_ci_label_guard.yml: a note says it's only needed when the caller'sci.ymldoesn't run the guard. Don't use both.CLAUDE.md: the fork-PR security model paragraph is updated to match.No reusable workflow under
.github/workflows/changes.Additional Context
synchronize" rule exists because asynchronizepayload still carriesallowed-for-ciuntil the guard strips it, socontains(labels)would race the guard. The same presence check also lets areopenedevent run acceptance if the label survived. And keeping the guard in a separate file means modules can miss it: pdk-templates rendersci.ymlfor modules that opt in, butfork_ci_label_guard.ymlis unmanaged by default (pdk-templates#670). (MODULES-11999) pdk update to pdk-templates main (8ca954f) puppetlabs-facter_task#252 shipped the trigger without the guard, which Copilot review flagged.synchronizeandclosedcan then only run the guard, never acceptance, soci.ymlcan carry the guard itself and the two can't drift apart. Acceptance still checks out the head SHA from thelabeledpayload.module_acceptance.yml'ssetup_matrixchecks out the fork head and runsbundle installwithPUPPET_FORGE_TOKENset beforeapproval_gate, so thepuppetcore-forkenvironment approval doesn't cover that job. The fork's Gemfile is evaluated with the token before anyone approves. That's worth its own change: run the gate first, or givesetup_matrixno token for fork PRs.Related Issues (if any)
MODULES-12062 (epic MODULES-11997), puppetlabs/pdk-templates#680. Follows CAT-2632 / CAT-2662.
Checklist
yamllint -c .yamllint .github/plus the two changed example files pass.actionlintpasses on both examples. (example/module/labeller.ymlalready fails yamllint on main; it's untouched here.)🤖 Generated with Claude Code