Skip to content

STF-1604: Analyze the merge commit in CodeQL on pull requests - #382

Open
oschwald wants to merge 1 commit into
mainfrom
greg/remove-codeql-head-checkout
Open

oschwald wants to merge 1 commit into
mainfrom
greg/remove-codeql-head-checkout

Conversation

@oschwald

@oschwald oschwald commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

The CodeQL init step warns on every run:

1 issue was detected with this workflow: git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.

This removes the git checkout HEAD^2 step and the fetch-depth: 2 it needed. On pull requests, CodeQL now analyzes the merge commit that actions/checkout fetches by default. The submodules: true setting stays. The init, autobuild, and analyze steps are unchanged.

This PR's own CodeQL run should show no warning in the "Initialize CodeQL" step.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the CodeQL workflow to use the default checkout behavior for pull requests.

Remove the git checkout HEAD^2 step and the fetch-depth it needed.
The CodeQL init action warns that the step is no longer necessary,
and code scanning recommends analyzing the merge commit, which
actions/checkout fetches by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 20:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: bc9a99c1-268e-43e8-89c8-706f0eeab573

📥 Commits

Reviewing files that changed from the base of the PR and between 1a33461 and 6c9a7a1.

📒 Files selected for processing (1)
  • .github/workflows/codeql-analysis.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/codeql-analysis.yml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The CodeQL workflow removes the fetch-depth limit and the pull-request-only checkout of HEAD^2. Submodule checkout remains enabled, and credential persistence remains disabled.

Changes

CodeQL checkout

Layer / File(s) Summary
Update checkout behavior
.github/workflows/codeql-analysis.yml
The checkout step no longer sets fetch-depth: 2. The workflow also removes the pull-request-only git checkout HEAD^2 step. Submodule checkout and disabled credential persistence remain.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 6c9a7

This change only adjusts how the CodeQL workflow checks out code, so that pull-request runs analyze the merge commit and stop emitting the warning. It does not affect production behavior, and no merge-blocking risk was found.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: CodeQL will analyze the merge commit for pull requests.
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…
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)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

A rabbit checks the workflow trail,
No shallow fetch will set the scale.
The submodules stay in view,
Credentials remain tucked from view.
I twitch my nose and hop away!

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants