ci: harden dependabot workflows + switch CodeQL to advanced setup - #59
Conversation
Prevents merging PRs that introduce correctness-gating jobs without also enforcing them on main — a job not in required checks can be skipped silently. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Default Setup auto-skips analysis on PRs that touch only workflow YAML, markdown, etc. With "Analyze (javascript-typescript)" listed as a required status check on main, those PRs got stuck in "Expected — Waiting for status to be reported" forever (e.g. #48). Advanced workflow runs on every PR with no paths-ignore, so the status is always posted. Matrix covers javascript-typescript + actions to match the prior default-setup language coverage. Default Setup must be disabled in Settings → Code security → CodeQL before this lands, otherwise jobs collide on the same category. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Address reviewer suggestions: - codeql.yml: pin actions/checkout to SHA + version comment to match sibling workflows (claude-pr-review-dependabot.yml, dependabot-lockfile-sync.yml). - AGENTS.md §14: close the new bullet with a period for consistency with siblings. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 43 minutes and 21 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds CodeQL security analysis to the repository with a new GitHub Actions workflow and documents updated CI governance rules. The workflow runs on main branch pushes, all pull requests, and a weekly schedule, scanning JavaScript/TypeScript and Actions code. The AGENTS.md update codifies that new tests must run in CI and correctness-gating CI jobs must be added to required status checks. ChangesCI Security and Governance
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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
🤖 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/codeql.yml:
- Around line 33-38: Update the workflow to pin the CodeQL actions to immutable
commit SHAs and disable checkout credential persistence: replace the mutable
refs `github/codeql-action/init@v3` and `github/codeql-action/analyze@v3` with
their respective full commit SHA pins, and add `with: persist-credentials:
false` to the `uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd`
step so credentials are not persisted.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: f16d3f15-3ac1-43ae-a698-cc87c45dd04f
📒 Files selected for processing (2)
.github/workflows/codeql.ymlAGENTS.md
Address CodeRabbit review on #59: - Pin github/codeql-action/init + analyze to commit SHA (v3.36.0 = 03e4368) so workflow can't shift under us if the v3 tag is ever moved. Matches the SHA-pinning style used in sibling workflows (claude-pr-review-dependabot.yml). - Add `persist-credentials: false` to actions/checkout. The CodeQL job has no need to push, so leaving the GITHUB_TOKEN in .git/config after checkout is unnecessary attack surface (artipacked / credential persistence). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AGENTS.md §14 policy: "Track third-party actions at their latest stable tag. Pin to SHA only when an action's repo has had a tag-moving incident." github/codeql-action is GitHub-owned and has had no such incident, so the SHA pin in f02b9e0 violated project policy. Revert to @V3. persist-credentials: false on checkout is kept — that's a separate security best practice unrelated to action versioning. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary - Updates AGENTS.md §14: third-party GitHub Actions must be pinned to a full commit SHA with `# vX.Y.Z` comment (Dependabot still bumps SHA+comment together). - GitHub-owned actions (\`actions/*\`, \`github/*\`) may keep tags; SHA preferred for defense-in-depth. ## Why Tag references can be silently rewritten by a compromised maintainer account. SHA pins are immutable. Dependabot supports SHA bumps when a \`# vX.Y.Z\` comment is present, so maintenance cost stays low. This change also corrects a self-inflicted bug surfaced in #59: I'd interpreted §14 as forbidding SHA pins on github-owned actions, which led to a tag-revert commit. The new wording removes that ambiguity. ## Follow-up (not in this PR) - Audit existing workflows and convert third-party tags to SHA pins. - Verify \`.github/dependabot.yml\` includes the \`github-actions\` ecosystem. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
claude-pr-review-dependabot.yml,dependabot-auto-merge.yml) per prior CodeRabbit pass..github/workflows/codeql.yml) so the required checkAnalyze (javascript-typescript)is always posted on every PR — not skipped when a PR touches only YAML/MD (this was the root cause of chore(deps): bump actions/checkout from 4 to 6 #48 staying in "Expected — Waiting for status to be reported" forever).main's required status checks in the same PR.Why CodeQL change matters
GitHub's CodeQL Default Setup auto-skips analysis on PRs that touch only workflow YAML or markdown. Branch protection on
mainrequiresAnalyze (javascript-typescript)→ check stays pending → PR unmergeable. Advanced workflow runs unconditionally, status always posted.Matrix
[javascript-typescript, actions]covers the same surface as prior Default Setup (actions, javascript, javascript-typescript, typescript);javascriptandtypescriptare deprecated aliases that resolve tojavascript-typescript.Operational prerequisite
Default Setup has already been disabled via API (
PATCH /repos/.../code-scanning/default-setup state=not-configured) before merging, to prevent both setups racing on the same category.Test plan
Analyze (javascript-typescript)+Analyze (actions))🤖 Generated with Claude Code