fix: exempt internal reusable workflow refs from action-pinning check#242
fix: exempt internal reusable workflow refs from action-pinning check#242don-petry wants to merge 195 commits into
Conversation
|
Warning Review limit reached
More reviews will be available in 21 minutes and 7 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (20)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CI is green (Lint, ShellCheck, AgentShield, SonarCloud all pass). CodeQL is still running but typically passes for bash-only changes. Self-review notes:
@petry-projects/org-leads — this PR fixes a false-positive in the compliance audit. Ready for review and merge. |
There was a problem hiding this comment.
Code Review
This pull request updates the compliance audit script to exempt internal reusable workflows from SHA-pinning requirements, aligning with organizational policy. The review feedback identifies a potential issue where the broad regex used for the exemption could lead to false negatives if the exclusion string appears within a comment on a line containing an unpinned third-party action. A more robust, anchored regex was suggested to ensure the exemption only applies to the action reference itself.
| # standards/ci-standards.md#exception-internal-reusable-workflow-references | ||
| local unpinned | ||
| unpinned=$(echo "$decoded" | grep -E '^\s*-?\s*uses:\s+[^#]*@' | grep -vE '@[0-9a-f]{40}' | grep -vE '(docker://|\.\/)' || true) | ||
| unpinned=$(echo "$decoded" | grep -E '^\s*-?\s*uses:\s+[^#]*@' | grep -vE '@[0-9a-f]{40}' | grep -vE '(docker://|\.\/)' | grep -vE 'petry-projects/\.github/' || true) |
There was a problem hiding this comment.
The regex petry-projects/\.github/ is applied to the entire line, which can lead to false negatives if a workflow file contains comments referencing the internal repository on the same line as an unpinned third-party action (e.g., uses: actions/checkout@v4 # see petry-projects/.github/).
To ensure the exemption only applies to the action reference itself and to improve the robustness of the existing exclusions, I suggest anchoring the regex to the uses: directive and consolidating the exclusions into a single anchored pattern.
| unpinned=$(echo "$decoded" | grep -E '^\s*-?\s*uses:\s+[^#]*@' | grep -vE '@[0-9a-f]{40}' | grep -vE '(docker://|\.\/)' | grep -vE 'petry-projects/\.github/' || true) | |
| unpinned=$(echo "$decoded" | grep -E '^\s*-?\s*uses:\s+[^#]*@' | grep -vE '@[0-9a-f]{40}' | grep -vE '^\s*-?\s*uses:\s+(docker://|\.\/|petry-projects/\.github/)' || true) |
There was a problem hiding this comment.
Pull request overview
Updates the org-wide compliance audit script to align check_action_pinning behavior with the documented exception that internal petry-projects/.github reusable workflows may use tag refs (e.g., @v1) instead of SHA pins, avoiding false-positive compliance findings.
Changes:
- Excludes
petry-projects/.githubreusable workflow references from the unpinned-action detection pipeline inscripts/compliance-audit.sh. - Adds inline comments linking the exclusion to the corresponding standards exception section.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: dc45fcd0a7cc56e045e81aad46b41a1f9b52e3fc
Review mode: triage-approved (single reviewer)
Summary
Confirms the triage assessment. This is a 4-line change to scripts/compliance-audit.sh adding a grep -vE 'petry-projects/\.github/' exclusion to check_action_pinning, with a clear inline comment pointing at the relevant exception in standards/ci-standards.md. Internal reusable workflow refs intentionally use @v1 tags rather than SHA pins, and the previous logic was generating false-positive compliance findings against caller stubs like dependabot-automerge.yml.
Linked issue analysis
Closes #239 (Compliance: unpinned-actions-dependabot-automerge.yml). The issue is itself an auto-filed false-positive — it flagged petry-projects/.github/.github/workflows/dependabot-automerge-reusable.yml@v1, which is exactly the kind of internal ref the new exclusion targets. Fix is substantively aligned with the issue.
Findings
- Scope is appropriately narrow. Only one function (
check_action_pinning) is touched; existing exclusions fordocker://and./are preserved. - Regex correctness.
petry-projects/\.github/correctly escapes the dot and includes a trailing/, so it won't spuriously exempt a hypotheticalpetry-projects/.github-otherrepo. - Minor nit (non-blocking, noted by gemini-code-assist). The new
grep -vEruns against full lines rather than the captureduses:ref. A line likeuses: actions/checkout@v4 # see petry-projects/.github/...would be silently filtered, masking a real third-party finding. Probability is very low in practice, and the surrounding pipeline already partially mitigates via[^#]*@. A future hardening could anchor the exclusion to the@portion of the ref. Not a blocker for this fix. - No security regression. The exemption is policy-aligned (documented in
standards/ci-standards.md#exception-internal-reusable-workflow-references); it does not weaken pinning for any third-party action.
CI status
All required checks green: Lint, ShellCheck, Agent Security Scan, AgentShield, SonarCloud, CodeQL, Claude Code, CodeRabbit, Dependency audit (ecosystem detector). Skipped jobs are conditional (Dependabot auto-merge, mention triggers, language-specific audits not applicable to this repo). SonarCloud Quality Gate passed with 0 new issues.
Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.
Pull request was closed
The merge-base changed after approval.
|
Auto-rebase failed — merge conflict — this branch has conflicts with Please resolve the conflicts and push: |
c17229f to
8913355
Compare
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: 802ad9bcaa94c13aa7383878957083951ad35997
Review mode: triage-approved (single reviewer)
Summary
Confirms the triage assessment. This is a 4-line change to scripts/compliance-audit.sh adding a grep -vE 'petry-projects/\.github/' exclusion to check_action_pinning, with an inline comment pointing at the documented exemption in standards/ci-standards.md#exception-internal-reusable-workflow-references. Since the prior (dismissed) review at c17229f, the only new commits are two merge-from-main commits (72305e4a, 802ad9bc) — no functional drift, the fix itself is unchanged.
Linked issue analysis
Closes #239 (Compliance: unpinned-actions-dependabot-automerge.yml), an auto-filed false-positive flagging petry-projects/.github/.github/workflows/dependabot-automerge-reusable.yml@v1. That ref is exactly the kind of internal reusable workflow the new exclusion targets, and standards/ci-standards.md explicitly exempts these refs from SHA pinning. Substantively addressed.
Findings
- Scope is appropriately narrow. Only one function (
check_action_pinning) is touched; existing exclusions fordocker://and./are preserved. - Regex correctness.
petry-projects/\.github/correctly escapes the dot and includes a trailing/, so it won't spuriously exempt a hypotheticalpetry-projects/.github-otherrepo. - Minor nit (non-blocking, previously noted by gemini-code-assist). The
grep -vEruns against full lines rather than the captureduses:ref. A line likeuses: actions/checkout@v4 # see petry-projects/.github/...would be silently filtered, masking a real third-party finding. Probability is very low in practice and the upstream[^#]*@partially mitigates. A future hardening could anchor the exclusion to the@-ref portion; not a blocker. - No security regression. The exemption is policy-aligned; it does not weaken pinning for any third-party action.
- Merge state.
mergeable: MERGEABLE;mergeStateStatus: BLOCKEDreflects review-required, not conflict. The earlierauto-rebase-conflictcomment from 2026-05-12 has since been resolved by the two merge-from-main commits.
CI status
Green: CodeQL (Analyze actions) SUCCESS, CodeRabbit SUCCESS. Author-reported additional checks (Lint, ShellCheck, AgentShield, SonarCloud Quality Gate — 0 new issues) also passed.
Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: 146bf90460a6ca6dfbd7b76cb94d9d9421d23b4c
Review mode: triage-approved (single reviewer)
Summary
Confirms the triage assessment. This is a 4-line change to scripts/compliance-audit.sh adding a grep -vE 'petry-projects/\.github/' exclusion to check_action_pinning, with an inline comment pointing at the documented exemption in standards/ci-standards.md#exception-internal-reusable-workflow-references. Since the prior approved review at 802ad9bc, the only new commits are two merge-from-main commits (a70a6ea0, 146bf904) that pull in unrelated upstream work (#281 auto-rebase fallback, #275 check-suite trigger fix); the fix itself is unchanged.
Linked issue analysis
Closes #239 (Compliance: unpinned-actions-dependabot-automerge.yml), an auto-filed false-positive flagging petry-projects/.github/.github/workflows/dependabot-automerge-reusable.yml@v1. That ref is exactly the kind of internal reusable workflow the new exclusion targets, and standards/ci-standards.md explicitly exempts these refs from SHA pinning. Substantively addressed.
Findings
- Scope is appropriately narrow. Only one function (
check_action_pinning) is touched; existing exclusions fordocker://and./are preserved. - Regex correctness.
petry-projects/\.github/correctly escapes the dot and includes a trailing/, so it won't spuriously exempt a hypotheticalpetry-projects/.github-otherrepo. - Minor nit (non-blocking, previously noted by gemini-code-assist). The
grep -vEruns against full lines rather than the captureduses:ref. A line likeuses: actions/checkout@v4 # see petry-projects/.github/...would be silently filtered, masking a real third-party finding. Probability is very low in practice and the upstream[^#]*@partially mitigates. A future hardening could anchor the exclusion to the@-ref portion; not a blocker. - No security regression. The exemption is policy-aligned; it does not weaken pinning for any third-party action.
- Merge state.
mergeable: MERGEABLE;mergeStateStatus: BLOCKEDreflects review-required, not conflict. The earlierauto-rebase-conflictcomment from 2026-05-12 has since been resolved by the merge-from-main commits.
CI status
All required checks green: Lint, ShellCheck, Agent Security Scan, Secret scan (gitleaks), AgentShield, SonarCloud (Quality Gate passed — 0 new issues), CodeQL (Analyze actions), Claude Code, CodeRabbit, Dependency audit (ecosystem detector). Skipped jobs are conditional (Dependabot auto-merge, language-specific audits not applicable, mention-triggered Claude jobs).
Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.
Superseded by automated re-review at 146bf90.
Automated review — human attention neededThis PR has been through 3 automated review cycles (cap: 3) without converging on an approval-and-merge state. Further automated review has been paused to avoid infinite loops. Please take a look manually, or close this PR if it's no longer needed. Once a human review resolves the situation, remove the Posted by the donpetry-bot PR-review cascade. |
…health enforcement (#326) * feat(compliance): add compliance-retrigger.sh to re-dispatch stale issues * feat(compliance): add compliance-retrigger.yml workflow (daily at 14:00 UTC)
774e6df to
be0dc1f
Compare
Dev-Lead — rebase (no-changes)Agent reasoning |
Dev-Lead — fix-bot-comment (applied)Changes committed and pushed. |
|
|
Auto-rebase failed — merge conflict — this branch has conflicts with dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention. To resolve manually instead: |
Dev-Lead Fix CI — appliedPR: #242 | SHA: |
|
Auto-rebase failed — merge conflict — this branch has conflicts with dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention. To resolve manually instead: |
|
Auto-rebase failed — merge conflict — this branch has conflicts with dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention. To resolve manually instead: |
|
Auto-rebase failed — merge conflict — this branch has conflicts with dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention. To resolve manually instead: |
|
Auto-rebase failed — merge conflict — this branch has conflicts with dev-lead will attempt to resolve this automatically. If it cannot, a follow-up comment will explain what needs manual attention. To resolve manually instead: |


Summary
check_action_pinningfunction inscripts/compliance-audit.shwas generating false-positive findings forpetry-projects/.githubreusable workflow refs (e.g.@v1tags)standards/ci-standards.md#exception-internal-reusable-workflow-referencesexplicitly exempts these refs from SHA pinning — they intentionally use tags and must NOT be SHA-pinnedgrep -vE 'petry-projects/\.github/'exclusion to filter out these refs from the unpinned-action detectionTest plan
dependabot-automerge.yml(or any other Tier 1 caller stub) for using@v1on internal reusable workflow refsactions/checkout@v4)scripts/compliance-audit.shwithDRY_RUN=trueto confirm no false-positiveaction-pinningfindings in the.githubrepoCloses #239
Generated with Claude Code