Skip to content

ci: run codeql on all prs via advanced setup - #4767

Open
nicktrn wants to merge 1 commit into
mainfrom
ci/codeql-advanced-setup
Open

ci: run codeql on all prs via advanced setup#4767
nicktrn wants to merge 1 commit into
mainfrom
ci/codeql-advanced-setup

Conversation

@nicktrn

@nicktrn nicktrn commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Default setup doesn't run CodeQL on pull requests from forks, so external contributions are stuck on PR checks that never come. Advanced setup fixes this.

Languages, categories and main coverage match the current default setup. The bare pull_request trigger (no branches filter) keeps stacked PRs scanned, whose base isn't main.

Default setup has to be disabled in Settings -> Code security for these uploads to be accepted. Until it is, the CodeQL check here fails with CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled.

Default setup does not run on pull requests from forks, so external
contributions currently ship unscanned. Advanced setup covers them: on
pull_request the analysis runs in the base repository's context, and the
code scanning upload endpoint accepts results from a fork's read-only
token.

The bare pull_request trigger (no branches filter) preserves today's
behaviour of scanning stacked PRs, whose base is not main.

Languages and categories match default setup exactly, so existing alerts
keep their analysis origin instead of being closed and recreated. The
repository guard skips the workflow in forks, where code scanning may be
unavailable; fork PRs still run, because on pull_request the guard is
evaluated against the base repository.

Default setup must be disabled for these uploads to be accepted -
CodeQL rejects results from advanced configurations while it is on.
@nicktrn nicktrn self-assigned this Aug 24, 2026
@changeset-bot

changeset-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e918a5c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a0be171d-6a5d-4fd9-9530-786004157129

📥 Commits

Reviewing files that changed from the base of the PR and between cc69ff4 and e918a5c.

📒 Files selected for processing (1)
  • .github/workflows/codeql.yml

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: code-quality / code-quality
  • GitHub Check: Analyze (actions)
  • GitHub Check: Zizmor
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: audit
  • GitHub Check: audit
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
🔇 Additional comments (2)
.github/workflows/codeql.yml (2)

1-12: LGTM!

Also applies to: 14-36


37-40: 🗄️ Data Integrity & Integration

Disable CodeQL default setup before merging.

If CodeQL default setup is enabled in triggerdotdev/trigger.dev, GitHub will reject SARIF uploads from this workflow. Keep default setup disabled while using this advanced setup workflow.


Walkthrough

Added a CodeQL workflow for pushes to main and pull requests. The workflow analyzes GitHub Actions and JavaScript/TypeScript code with separate matrix entries. It sets minimal permissions, cancels outdated runs, uses credential-free checkout, and pins CodeQL initialization and analysis actions.

Merge Risk: 🔵 Low · up to e918a

The new workflow enables CodeQL scanning for pull requests, including forked contributions, but uploads will fail until CodeQL default setup is disabled for the repository. The PR is otherwise mergeable with explicit owner follow-up on that configuration change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the CodeQL change but omits the required issue, checklist, testing, changelog, and screenshots sections. Add the required template sections and complete the checklist, testing steps, changelog, and screenshots fields as applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the CodeQL CI change and its pull request coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/codeql-advanced-setup

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Copy link
Copy Markdown
Contributor

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

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.

1 participant