Merged
Conversation
…rkflow ✨ add CodeQL analysis workflow configuration
Reviewer's GuideAdds a new GitHub Actions workflow to run CodeQL advanced security scans for JavaScript/TypeScript on main branch pushes, pull requests, and a weekly schedule. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `.github/workflows/codeql.yml:57-58` </location>
<code_context>
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ # Add any setup steps before running the `github/codeql-action/init` action.
</code_context>
<issue_to_address>
**🚨 suggestion (security):** Pin GitHub Actions to commit SHAs instead of floating major versions
Using `@v4` means any future v4 release is automatically trusted. For stronger supply-chain security, pin `actions/checkout` (and other third‑party actions in this workflow) to specific commit SHAs, optionally with a comment noting the corresponding tagged version.
Suggested implementation:
```
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
```
```
- name: Initialize CodeQL
uses: github/codeql-action/init@c723c2bcdac4f49a15190108bcede8f971c53e10 # v4.0.0
with:
languages: ${{ matrix.language }}
```
</issue_to_address>
### Comment 2
<location> `.github/workflows/codeql.yml:28-31` </location>
<code_context>
+ # - https://gh.io/supported-runners-and-hardware-resources
+ # - https://gh.io/using-larger-runners (GitHub.com only)
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
+ permissions:
+ # required for all workflows
</code_context>
<issue_to_address>
**suggestion:** Simplify or align the runner selection with the current language matrix
The `runs-on` condition special-cases `swift`, but the matrix only defines `javascript-typescript`. This is harmless but misleading about supported languages. Either remove the Swift branch for now or add a Swift entry to the matrix so the special-casing is justified.
```suggestion
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ubuntu-latest
permissions:
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
CI: