chore(build): add gitleaks secret scanning workflow#124
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 19 minutes and 52 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a GitHub Actions workflow file that implements gitleaks secret scanning. The workflow runs on pull requests and pushes to main, checking out the repository and executing the gitleaks-action with necessary credentials passed from GitHub secrets. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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: 1
🧹 Nitpick comments (1)
.github/workflows/gitleaks.yml (1)
13-16: Pin action references to immutable SHAs.Using
@v4and@v2leaves the workflow trusting movable tags. Pinning both actions to full commit SHAs hardens the workflow against upstream tag retargeting.Hardening example
- - uses: actions/checkout@v4 + - uses: actions/checkout@<full-length-commit-sha> with: fetch-depth: 0 - - uses: gitleaks/gitleaks-action@v2 + - uses: gitleaks/gitleaks-action@<full-length-commit-sha>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/gitleaks.yml around lines 13 - 16, The workflow currently references movable tags "uses: actions/checkout@v4" and "uses: gitleaks/gitleaks-action@v2"; replace those with the corresponding immutable commit SHAs for the actions (e.g., actions/checkout@<full-commit-sha> and gitleaks/gitleaks-action@<full-commit-sha>) by looking up the commit SHA in each action's GitHub repo and updating the uses entries so the workflow pins to the exact commit rather than a tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/gitleaks.yml:
- Line 4: The Gitleaks job is failing for forked PRs because
secrets.GITLEAKS_LICENSE is unavailable; update the workflow triggered by
pull_request to guard the job (e.g., the gitleaks job) with a conditional that
detects forks (use github.event.pull_request.head.repo.fork or
github.repository_owner != github.actor) and skip running when true, or
implement a non-licensed fallback path that avoids referencing
secrets.GITLEAKS_LICENSE for forked PRs; modify the job definition that
currently runs on pull_request to check this condition before accessing
secrets.GITLEAKS_LICENSE so external PRs do not fail.
---
Nitpick comments:
In @.github/workflows/gitleaks.yml:
- Around line 13-16: The workflow currently references movable tags "uses:
actions/checkout@v4" and "uses: gitleaks/gitleaks-action@v2"; replace those with
the corresponding immutable commit SHAs for the actions (e.g.,
actions/checkout@<full-commit-sha> and
gitleaks/gitleaks-action@<full-commit-sha>) by looking up the commit SHA in each
action's GitHub repo and updating the uses entries so the workflow pins to the
exact commit rather than a tag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 02b2f9fe-30aa-40c5-8c8f-56e02414f731
📒 Files selected for processing (1)
.github/workflows/gitleaks.yml
Summary
gitleaks/gitleaks-action@v2withGITLEAKS_LICENSEsecretReference: questdb/questdb#6863
Summary by CodeRabbit