Skip to content

fix: pin agent-shield reusable workflow to SHA#132

Open
don-petry wants to merge 63 commits into
mainfrom
claude/issue-104-20260414-1421
Open

fix: pin agent-shield reusable workflow to SHA#132
don-petry wants to merge 63 commits into
mainfrom
claude/issue-104-20260414-1421

Conversation

@don-petry

@don-petry don-petry commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pins uses: petry-projects/.github/.github/workflows/agent-shield-reusable.yml@v1 to its commit SHA (208ec2d69b75227d375edf8745d84fbac05a76b2)
  • Adds # v1 comment for human readability per the org action-pinning policy

Compliance

Resolves the compliance finding from the weekly audit: unpinned-actions-agent-shield.yml.

Standard: standards/ci-standards.md#action-pinning-policy

SHA was looked up via:

gh api repos/petry-projects/.github/git/refs/tags/v1 --jq '.object.sha'
# → 208ec2d69b75227d375edf8745d84fbac05a76b2

Closes #104

Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated workflow configurations to enhance build reliability and process consistency.

Copilot AI review requested due to automatic review settings April 14, 2026 14:23
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 4 minutes and 17 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d9677903-3f0d-48ea-abf5-05723d85afcb

📥 Commits

Reviewing files that changed from the base of the PR and between 65508b9 and 403fd5a.

📒 Files selected for processing (4)
  • .github/workflows/claude-code-reusable.yml
  • scripts/compliance-audit.sh
  • standards/dependabot-policy.md
  • standards/workflows/agent-shield.yml
📝 Walkthrough

Walkthrough

Both workflow files update their reusable workflow references from a floating version tag (@v1) to a pinned commit SHA (@208ec2d69b75227d375edf8745d84fbac05a76b2), bringing the workflows into compliance with the action-pinning policy.

Changes

Workflow Reference Pinning

Layer / File(s) Summary
Workflow Configuration
.github/workflows/agent-shield.yml, standards/workflows/agent-shield.yml
Reusable workflow reference uses: directive updated from floating @v1 tag to pinned commit SHA for compliance with action-pinning policy.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

  • #104 – Directly addresses the compliance finding for unpinned agent-shield.yml action by pinning the reusable workflow reference to a specific commit SHA.

Possibly related PRs

  • petry-projects/.github#88: Modifies the same callable in standards/workflows/agent-shield.yml by pinning the reusable-workflow reference.
  • petry-projects/.github#87: Updates the agent-shield workflow's reusable-workflow invocation with a specific version reference.
  • petry-projects/.github#159: Related to the same agent-shield workflow; marks it as immutable/exempt from SHA-pinning requirements.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: pinning the agent-shield reusable workflow reference to a specific commit SHA instead of the floating @v1 tag.
Linked Issues check ✅ Passed The PR successfully addresses issue #104 by pinning the reusable workflow reference from @v1 to commit SHA 208ec2d69b75227d375edf8745d84fbac05a76b2, fully complying with the action-pinning policy.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the issue requirements: updating workflow references to pinned SHAs in both the live workflow and standards template for consistency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-104-20260414-1421

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Pins the repository’s AgentShield caller workflow to a specific commit SHA to comply with the org’s GitHub Actions pinning policy and resolve the reported compliance finding.

Changes:

  • Replaces the reusable workflow reference from @v1 to a full commit SHA.
  • Adds a # v1 inline comment for human-readable version context.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/agent-shield.yml Outdated
@don-petry

don-petry commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author
Outdated review (superseded by re-review at a45317f45210bb2b3a47c37eeccce66b0d7f5065) — click to expand.

Automated review — APPROVED

Risk: LOW
Reviewed commit: d1dd76517ffdc864b41f13fb1083a3228d805770
Cascade: triage(haiku) → sonnet

Note: Automated approval could not be recorded as a formal review (GitHub prevents self-approval). Review verdict: APPROVE.

Summary

This PR pins a reusable workflow reference from a mutable tag (@v1) to a pinned SHA per the org's action-pinning policy, resolving compliance issue #104. All CI checks pass (Lint, ShellCheck, CodeQL, SonarCloud, Agent Security Scan). The change is a net security improvement with no risk signals beyond a minor SHA-verification caveat.

Findings

Minor

  • ⚠️ .github/workflows/agent-shield.yml:33sha-verification: The SHA was looked up via gh api .../git/refs/tags/v1 --jq '.object.sha'. For annotated tags, this returns the tag-object SHA, not the commit SHA — GitHub Actions requires the commit SHA for uses: pinning. For lightweight tags the command is correct. If v1 is an annotated tag, the pin may silently resolve incorrectly. No runtime failure is visible in CI because the reusable workflow is not exercised in this PR's test suite. Recommend verifying with: gh api repos/petry-projects/.github/git/ref/tags/v1 --jq '.object | if .type == "commit" then .sha else "annotated-tag: dereference needed" end'

Info

  • triage: Triage was escalated due to invalid output (triage-output-invalid), not because of actual risk signals in the diff. This is a routine compliance fix.
  • merge-status: Branch is behind main (mergeStateStatus: BEHIND). A rebase or merge commit is needed before merging, but this does not affect correctness of the change.

CI status

All CI checks pass: Lint, ShellCheck, CodeQL, SonarCloud, Agent Security Scan.


Reviewed by the don-petry PR-review cascade (triage: haiku 4.5 → deep: sonnet 4.6 → audit: opus 4.6). Reply with @don-petry if you need a human.

@don-petry don-petry enabled auto-merge (squash) April 15, 2026 23:21
@don-petry

Copy link
Copy Markdown
Contributor Author

@claude[agent] - Address the open comments. Ensure the standard is also updated with the SHA pinning as part of this PR.

@Claude Claude AI force-pushed the claude/issue-104-20260414-1421 branch from 9a26863 to fee3ae1 Compare April 16, 2026 01:02
@Claude

Claude AI commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

@claude[agent] - Address the open comments. Ensure the standard is also updated with the SHA pinning as part of this PR.

Updated standards/workflows/agent-shield.yml to pin the reusable workflow to the same SHA (@208ec2d69b75227d375edf8745d84fbac05a76b2) with the # v1 comment. Both files now match.

Commit: fee3ae1

@don-petry

don-petry commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author
Outdated review (superseded by re-review at a45317f45210bb2b3a47c37eeccce66b0d7f5065) — click to expand.

Automated review — APPROVED

Risk: LOW
Reviewed commit: fee3ae1715b4852df6000915d6d0a474f8bd1e36
Cascade: triage → deep (see triage: haiku 4.5 → deep: sonnet 4.6 + duck: gpt-5.4 → audit: opus 4.6 for models)

Note: Review posted as comment — GitHub does not permit self-approval on this PR.

Summary

This PR pins a reusable workflow reference from @v1 to a commit SHA in both the live workflow and the standards template, resolving compliance finding #104. All CI checks pass (CodeQL, CodeRabbit, SonarCloud) and the new commit directly addresses the prior review's request to update the standards file. Triage escalated due to an internal output failure, not actual risk signals.

Findings

Minor

  • [minor] .github/workflows/agent-shield.yml:33 — The SHA 208ec2d69b75227d375edf8745d84fbac05a76b2 was obtained via gh api .../git/refs/tags/v1 --jq .object.sha. For annotated tags this returns the tag-object SHA, not the commit SHA; GitHub Actions pinning requires the commit SHA. For lightweight tags the command is correct. CI passes and no runtime failure is observed, suggesting the tag is lightweight or the SHA is correct. To verify definitively: gh api repos/petry-projects/.github/git/ref/tags/v1 --jq '.object | if .type == "commit" then "OK: " + .sha else "annotated-tag: dereference needed" end'

Info

  • [info] Triage escalated with signal triage-output-invalid — this reflects a triage process failure, not a risk in the diff. The actual change is a 2-line compliance fix.
  • [info] standards/workflows/agent-shield.yml:33 — The new commit (fee3ae1) correctly mirrors the SHA pin in standards/workflows/agent-shield.yml, keeping the live workflow and its template in sync. This fully addresses the prior review feedback.
  • [info] All CI checks passed: CodeQL (SUCCESS), CodeRabbit (SUCCESS), SonarCloud Quality Gate (PASSED, 0 new issues, 0 security hotspots).

CI status

All CI checks passed: CodeQL (SUCCESS), CodeRabbit (SUCCESS), SonarCloud Quality Gate (PASSED, 0 new issues, 0 security hotspots).


Reviewed by the don-petry PR-review cascade (triage: haiku 4.5 → deep: sonnet 4.6 + duck: gpt-5.4 → audit: opus 4.6). Reply with @don-petry if you need a human.

@github-actions

Copy link
Copy Markdown
Contributor

Auto-rebase failed — merge conflict — this branch has conflicts with main that must be resolved manually.

Please resolve the conflicts and push:

git fetch origin
git merge origin/main
# resolve conflicts, then:
git add .
git commit
git push

@petry-projects-pr-review-agent petry-projects-pr-review-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed by the don-petry PR-review cascade (triage: haiku 4.5 → deep: sonnet 4.6 + duck: gpt-5.4 → audit: opus 4.6). Reply with @don-petry if you need a human.

This was referenced May 1, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 4, 2026
@github-actions github-actions Bot requested a review from a team as a code owner May 4, 2026 20:32
donpetry-bot
donpetry-bot previously approved these changes May 5, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed by the don-petry PR-review cascade (triage: haiku 4.5 → deep: sonnet 4.6 + duck: gpt-5.4 → audit: opus 4.6). Reply with @don-petry if you need a human.

@don-petry

Copy link
Copy Markdown
Contributor Author

@claude Please address all open review comments on this PR from CodeRabbit and Copilot.

@claude

claude Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Claude finished @don-petry's task in 1m 12s —— View job


Review comments addressed

  • Gather context and read current file state
  • Verify Copilot comment (standards file sync) is resolved
  • Verify CodeRabbit comments are resolved
  • No remaining issues — no changes needed
  • Final status report

All open CodeRabbit and Copilot comments have already been resolved:

Copilot.github/workflows/agent-shield.yml:33: The concern was that standards/workflows/agent-shield.yml was out of sync (still using @v1). This was fixed in commit fee3ae1. Both files now identically pin to:

uses: petry-projects/.github/.github/workflows/agent-shield-reusable.yml@208ec2d69b75227d375edf8745d84fbac05a76b2 # v1

CodeRabbit — Latest review (2026-05-04): Approved with no actionable comments. Nothing to address.

The PR diff confirms both files are updated symmetrically — .github/workflows/agent-shield.yml and standards/workflows/agent-shield.yml are identical, keeping the source-of-truth header accurate.

Note on the SHA verification finding from the automated don-petry review: that was flagged as informational (not blocking) and is outside the scope of CodeRabbit/Copilot comments. If you want me to verify whether 208ec2d69b75227d375edf8745d84fbac05a76b2 is a commit SHA or tag-object SHA, let me know and I can run the check.

This was referenced May 7, 2026

Copy link
Copy Markdown
Contributor Author

@claude There is an unresolved Copilot review comment on this PR (created 2026-04-14, before the comment-trigger was added to claude.yml):

.github/workflows/agent-shield.yml header says the source of truth is standards/workflows/agent-shield.yml, but after this change the two files will drift (standards/workflows/agent-shield.yml still uses @v1). To keep the source-of-truth statement accurate (and to avoid reintroducing noncompliant templates for downstream repos), please update the standards template to the same SHA + # v1 comment.

Please:

  1. Update standards/workflows/agent-shield.yml to pin agent-shield-reusable.yml@<sha> # v1 matching the SHA used in .github/workflows/agent-shield.yml (currently 208ec2d69b75227d375edf8745d84fbac05a76b2).
  2. Verify no other consumers of the standard expect the @v1 form.
  3. Commit + push to this branch and resolve the review thread.

Generated by Claude Code

@claude

claude Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Claude finished @don-petry's task in 51s —— View job


Copilot review comment — already resolved

  • Read current state of both workflow files
  • Verify no other consumers reference @v1
  • Confirm standards/workflows/agent-shield.yml is already updated
  • No commit needed — fix was applied in a previous commit

Both files are already identical and correctly pinned:

.github/workflows/agent-shield.yml:33 and standards/workflows/agent-shield.yml:33:

uses: petry-projects/.github/.github/workflows/agent-shield-reusable.yml@208ec2d69b75227d375edf8745d84fbac05a76b2 # v1

No other files in the repository reference agent-shield-reusable.yml, so there are no additional consumers to update.

The Copilot review thread can be marked as resolved — the fix was committed in fee3ae1 (2026-04-16). The PR is ready to merge.

@don-petry don-petry closed this May 11, 2026
auto-merge was automatically disabled May 11, 2026 21:35

Pull request was closed

@don-petry don-petry force-pushed the claude/issue-104-20260414-1421 branch from 9391be6 to 861c911 Compare June 8, 2026 22:01
@don-petry don-petry enabled auto-merge (squash) June 8, 2026 22:02
@don-petry don-petry disabled auto-merge June 8, 2026 22:04
@don-petry don-petry enabled auto-merge (squash) June 8, 2026 22:14
@don-petry don-petry disabled auto-merge June 8, 2026 22:16
@don-petry don-petry enabled auto-merge (squash) June 8, 2026 22:25
@don-petry don-petry disabled auto-merge June 8, 2026 22:28
@don-petry don-petry enabled auto-merge (squash) June 8, 2026 22:38
@don-petry don-petry disabled auto-merge June 8, 2026 22:43
@don-petry don-petry enabled auto-merge (squash) June 8, 2026 22:53
@don-petry don-petry disabled auto-merge June 8, 2026 23:07
@don-petry don-petry enabled auto-merge (squash) June 8, 2026 23:20
@don-petry don-petry disabled auto-merge June 8, 2026 23:20
@don-petry don-petry enabled auto-merge (squash) June 8, 2026 23:24
@don-petry don-petry disabled auto-merge June 9, 2026 03:30
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry don-petry enabled auto-merge (squash) June 9, 2026 03:39
@don-petry don-petry disabled auto-merge June 9, 2026 03:40
@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry don-petry enabled auto-merge (squash) June 9, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compliance: unpinned-actions-agent-shield.yml

4 participants