Skip to content

ci: switch CodeQL to advanced setup for re-run support - #714

Merged
lizhengfeng101 merged 1 commit into
mainfrom
lizhengfeng101-patch-1
Aug 4, 2026
Merged

ci: switch CodeQL to advanced setup for re-run support#714
lizhengfeng101 merged 1 commit into
mainfrom
lizhengfeng101-patch-1

Conversation

@lizhengfeng101

@lizhengfeng101 lizhengfeng101 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Switch CodeQL from default setup to advanced (self-managed workflow) to:

  • Support re-running cancelled workflow runs
  • Prevent new pushes from cancelling in-progress scans (cancel-in-progress: false)

Type of Change

  • CI / Build / Tooling

Checklist

  • I have performed a self-review of my code

@lizhengfeng101 lizhengfeng101 changed the title Create codeql.yml ci: switch CodeQL to advanced setup for re-run support Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 4 issue(s) in this PR.

  • ✅ Successfully posted inline: 4 comment(s)


concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false

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.

[performance · low]
cancel-in-progress: false means that when multiple pushes happen in quick succession to the same branch, superseded runs will continue to completion and consume runner resources even though their results are outdated. For a code scanning workflow like CodeQL, setting cancel-in-progress: true is generally preferred to free up runners for the latest analysis.

Suggestion:

Suggested change
cancel-in-progress: false
cancel-in-progress: true

# - 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' }}

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.

[performance · medium]
The analyze job does not specify timeout-minutes. CodeQL analysis can occasionally hang or take excessively long (especially during autobuild for Go), and without an explicit timeout the job could run up to GitHub's default limit (6 hours for public repos). Adding a reasonable timeout (e.g., 60–120 minutes) will prevent hung jobs from wasting runner resources.

Suggestion:

Suggested change
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: 120

# 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@v7

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.

[other · high]
actions/checkout@v7 is referenced here. As of the latest widely known releases, v4 is the current major version of actions/checkout. Please verify that v7 is a valid and published release — using a non-existent version tag will cause the workflow to fail at runtime. If v7 does not exist, use actions/checkout@v4 instead.

Suggestion:

Suggested change
uses: actions/checkout@v7
uses: actions/checkout@v4

# 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@v7

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.

[other · low]
Upon further review, I see this is consistent with other workflows in the repository (e.g., ci.yml also uses actions/checkout@v7). No issue here — the version is consistent across the project.

@css521 css521 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@lizhengfeng101
lizhengfeng101 merged commit ae3eab9 into main Aug 4, 2026
12 checks passed
@lizhengfeng101
lizhengfeng101 deleted the lizhengfeng101-patch-1 branch August 4, 2026 11:51
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.

2 participants