Repository navigation
feat(scripts): guard sync-policies against outdated PrGovernance pins - #72
Conversation
Co-authored-by: Antigravity <noreply@google.com>
AI Code Review (opencode /
|
Co-authored-by: Antigravity <noreply@google.com>
AI Code Review (opencode /
|
AI assistance
What changed
MIN_POLICY_PIN_SHA(b540fc2eed7fa0a80c1a70b419581df2a49b0eec),extractRiskGatePin(), andisPinAtLeast()toscripts/sync-policies.mjs.chore/policy-tierPR,sync-policies.mjschecks.github/workflows/risk-gate.ymlon the target repository's default branch and compares the pinnedCodeGovernanceLab/PrGovernanceSHA againstMIN_POLICY_PIN_SHA(unless--skip-pin-checkis explicitly passed), safely skipping repositories still on older evaluators so unknown policy keys never break downstreamrisk-gatevalidation.extractRiskGatePinandisPinAtLeastinscripts/test-sync-policies.cjs.How verified
node --test pr-governance/scripts/test-*.cjs scripts/test-*.cjs: all tests passed (0 failures).node scripts/sync-policies.mjs --dry-run --org Pigbibi: verified outdated repositories are safely skipped (skipped 7, failed 0)./usr/local/bin/gitleaks git --config pr-governance/.gitleaks.toml --log-opts="origin/main..HEAD" --redact:no leaks found.Why
require_clearing_label_on_r2,require_owner_approval_on_r2) before updatingPrGovernancepins breaks downstreamvalidatePolicy(sameKeys).Risk
scripts/sync-policies.mjs,scripts/test-sync-policies.cjs): operator CLI script and unit tests only; nopr-governance/evaluator changes.