Skip to content

chore: add CodeQL security scanning workflow#3

Open
100yenadmin wants to merge 2 commits into
mainfrom
chore/add-codeql
Open

chore: add CodeQL security scanning workflow#3
100yenadmin wants to merge 2 commits into
mainfrom
chore/add-codeql

Conversation

@100yenadmin
Copy link
Copy Markdown
Member

@100yenadmin 100yenadmin commented Apr 2, 2026

Adds CodeQL JS/TS analysis. Required by repo ruleset.


Open with Devin

Adds CodeQL JS/TS analysis on push to main and PRs.
Required by repo ruleset.
Copilot AI review requested due to automatic review settings April 2, 2026 16:45
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions workflow to run CodeQL analysis for the repository’s JavaScript/TypeScript code, aligning with the repo ruleset requirement for security scanning.

Changes:

  • Introduces a new CodeQL GitHub Actions workflow triggered on pushes and PRs to main.
  • Configures CodeQL to run the security-and-quality query suite for javascript-typescript.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

timeout-minutes: 10
permissions:
security-events: write
contents: read
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The job permissions are missing actions: read, which the GitHub CodeQL workflow template includes and which can be required in repos/orgs that set the default GITHUB_TOKEN permissions to “read repository contents only”. Add actions: read to the job (or workflow) permissions to avoid CodeQL failures in locked-down environments.

Suggested change
contents: read
contents: read
actions: read

Copilot uses AI. Check for mistakes.
with:
languages: javascript-typescript
queries: security-and-quality

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For TypeScript repositories, CodeQL JS/TS analysis is typically more accurate when dependencies are installed and the project is built (so the extractor can resolve types/config). Consider adding steps between init and analyze to run npm ci (and npm run build if needed) so the scan reflects the actual compiled/typed code.

Suggested change
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build (if applicable)
run: npm run build --if-present

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/codeql.yml Outdated
Comment on lines +18 to +27
- uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript-typescript
queries: security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These steps reference third-party actions by mutable tags (e.g., @v4, @v3). If this repo aims for stronger supply-chain guarantees, pin actions to a full commit SHA (optionally keeping the major tag in a comment) to reduce the risk of a compromised upstream release.

Suggested change
- uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: javascript-typescript
queries: security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Initialize CodeQL
uses: github/codeql-action/init@6db8d2e1e5de55e90d24df76ebe7d7318f637bee # v3
with:
languages: javascript-typescript
queries: security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@6db8d2e1e5de55e90d24df76ebe7d7318f637bee # v3

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants