chore(ci): add CodeQL security analysis workflow#367
chore(ci): add CodeQL security analysis workflow#367CodeGhost21 wants to merge 2 commits intotinyhumansai:mainfrom
Conversation
Enable GitHub CodeQL static analysis for javascript-typescript on push/PR to main and weekly schedule to catch security vulnerabilities automatically. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdded a new GitHub Actions workflow Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/codeql.yml (1)
3-10: Consider adding manual trigger support for incident/debug runs.
workflow_dispatchwould let maintainers run CodeQL on demand (outside push/PR/schedule windows), which is useful for triage and rule-tuning.♻️ Proposed change
on: + workflow_dispatch: push: branches: [main] pull_request: branches: [main] schedule: # Weekly drift scan — Sundays at 04:30 UTC - cron: '30 4 * * 0'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/codeql.yml around lines 3 - 10, Add a manual trigger to the workflow by updating the on: block (where push, pull_request, and schedule are defined) to include the workflow_dispatch event so maintainers can run the CodeQL workflow on demand; specifically add the workflow_dispatch key alongside push/pull_request/schedule in the existing on: configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/codeql.yml:
- Around line 3-10: Add a manual trigger to the workflow by updating the on:
block (where push, pull_request, and schedule are defined) to include the
workflow_dispatch event so maintainers can run the CodeQL workflow on demand;
specifically add the workflow_dispatch key alongside push/pull_request/schedule
in the existing on: configuration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9e8f1a29-9640-4460-8040-00b6457e4531
📒 Files selected for processing (1)
.github/workflows/codeql.yml
- Scan actions, javascript-typescript, and rust (drop unused ruby) - Use build-mode: none for all languages, remove autobuild step - Bump codeql-action to v4, add security-and-quality query suite Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/codeql.yml (1)
41-51: Pin GitHub Actions to immutable SHAs for supply-chain hardening.
actions/checkout@v4,github/codeql-action/init@v4, andgithub/codeql-action/analyze@v4use mutable version tags. Pin each to a full commit SHA (40-character hex) instead to prevent tampering.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/codeql.yml around lines 41 - 51, The workflow currently references mutable tags actions/checkout@v4, github/codeql-action/init@v4, and github/codeql-action/analyze@v4; replace each of these with their corresponding immutable full 40-character commit SHAs to harden the supply chain (update the uses values for actions/checkout, github/codeql-action/init, and github/codeql-action/analyze in the CodeQL job). Fetch the correct commit SHAs from the respective GitHub action repositories/releases and substitute the tag strings with the full SHA values in the workflow so the uses entries point to fixed commits instead of version tags.
🤖 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/codeql.yml:
- Around line 9-10: The workflow cron schedule and its comment are out of sync
with the PR objective; update the cron entry currently set to '37 9 * * 6' in
.github/workflows/codeql.yml to the Sunday 04:30 UTC schedule '30 4 * * 0' and
change the accompanying comment "Weekly drift scan — Saturdays at 09:37 UTC" to
"Weekly drift scan — Sundays at 04:30 UTC" so the code and documentation match
(ensure UTC is preserved).
---
Nitpick comments:
In @.github/workflows/codeql.yml:
- Around line 41-51: The workflow currently references mutable tags
actions/checkout@v4, github/codeql-action/init@v4, and
github/codeql-action/analyze@v4; replace each of these with their corresponding
immutable full 40-character commit SHAs to harden the supply chain (update the
uses values for actions/checkout, github/codeql-action/init, and
github/codeql-action/analyze in the CodeQL job). Fetch the correct commit SHAs
from the respective GitHub action repositories/releases and substitute the tag
strings with the full SHA values in the workflow so the uses entries point to
fixed commits instead of version tags.
🪄 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: 6d0c896f-19de-4b5b-b323-c2f2e759e039
📒 Files selected for processing (1)
.github/workflows/codeql.yml
| # Weekly drift scan — Saturdays at 09:37 UTC | ||
| - cron: '37 9 * * 6' |
There was a problem hiding this comment.
Schedule does not match the stated PR objective.
Line 10 is configured for Saturday 09:37 UTC, but the PR objective states a weekly run on Sunday 04:30 UTC. Please align code and PR documentation to avoid ops confusion.
🔧 Suggested change (if the objective is the source of truth)
- # Weekly drift scan — Saturdays at 09:37 UTC
- - cron: '37 9 * * 6'
+ # Weekly drift scan — Sundays at 04:30 UTC
+ - cron: '30 4 * * 0'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Weekly drift scan — Saturdays at 09:37 UTC | |
| - cron: '37 9 * * 6' | |
| # Weekly drift scan — Sundays at 04:30 UTC | |
| - cron: '30 4 * * 0' |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/codeql.yml around lines 9 - 10, The workflow cron schedule
and its comment are out of sync with the PR objective; update the cron entry
currently set to '37 9 * * 6' in .github/workflows/codeql.yml to the Sunday
04:30 UTC schedule '30 4 * * 0' and change the accompanying comment "Weekly
drift scan — Saturdays at 09:37 UTC" to "Weekly drift scan — Sundays at 04:30
UTC" so the code and documentation match (ensure UTC is preserved).
|
github automatically works on this |
Summary
.github/workflows/codeql.yml) forjavascript-typescriptmainplus weekly scheduled scan (Sundays 04:30 UTC)security-and-qualityquery suite for broader coverageTest plan
🤖 Generated with Claude Code
Closes #104
Summary by CodeRabbit