chore(build): guard gitleaks license and pin action SHA#61
Conversation
📝 WalkthroughWalkthroughThe ChangesGitleaks Workflow Update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/gitleaks.yml:
- Line 15: The actions/checkout action on line 15 uses a floating tag (`@v4`)
instead of a pinned commit SHA, which creates supply-chain risk and differs from
the gitleaks action pinning approach on line 18. Replace the `@v4` tag with a full
commit SHA (in the format @<full-commit-hash>) to match the security and
consistency practices already established by the pinned gitleaks action in the
same workflow.
- Around line 16-17: The checkout action in the gitleaks workflow is missing the
persist-credentials setting. Add persist-credentials: false to the with section
of the checkout action (where fetch-depth: 0 is currently specified) to prevent
unnecessary exposure of the GITHUB_TOKEN in git config, since gitleaks-action
receives the token via environment variables and does not require authenticated
git access.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2f9747e5-e930-44b7-9927-4c3d96b5c233
📒 Files selected for processing (1)
.github/workflows/gitleaks.yml
Summary
GITLEAKS_LICENSEis unavailablegitleaks/gitleaks-actionto commit83d9cd684c87d95d656c1458ef04895a7f1cbd8eWhy
Public forks do not have access to
GITLEAKS_LICENSE, so the workflow should skip that step instead of failing on forked pull requests.Summary by CodeRabbit