ci(PRODSEC-343): consolidate CodeQL workflows into single unified scan#1
Closed
anguprasad07 wants to merge 1 commit into
Closed
ci(PRODSEC-343): consolidate CodeQL workflows into single unified scan#1anguprasad07 wants to merge 1 commit into
anguprasad07 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Findings (by severity):
- blocker: none
- high:
.github/workflows/codeql.yml:26Reusable workflow is pinned to a mutable ref (@master), which is a supply-chain/reproducibility risk.
- medium:
.github/workflows/codeql.yml:28-31save-cacheis enabled for all non-PR runs, including manual scans of an arbitraryref, which can overwrite the intended “overlay-base” cache.
- low:
.github/workflows/codeql.yml:12-14PR branch filter is commented out; other workflows in this repo explicitly scope tobranches: [main].
This PR introduces a unified GitHub Actions workflow to run CodeQL scans (scheduled, manual, and PR-triggered) via a shared reusable workflow, aiming to replace/standardize previous scanning setups.
Changes:
- Adds a single
codeql.ymlworkflow handling schedule,workflow_dispatch(with optional ref), and PR events. - Adds concurrency behavior to cancel in-progress PR scans when new commits arrive.
- Toggles cache-saving behavior so only non-PR runs save the overlay-base cache.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Skip draft PRs. Non-PR events are never drafts so this guard is a no-op | ||
| # for schedule/workflow_dispatch. | ||
| if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }} | ||
| uses: KeepTruckin/security-scanners/.github/workflows/codeql-scan.yml@master |
Comment on lines
+29
to
+31
| # Full scans (schedule/dispatch) seed the overlay-base cache for PR scans. | ||
| # PR scans restore it read-only — they must NOT overwrite it. | ||
| save-cache: ${{ github.event_name != 'pull_request' }} |
| default: '' | ||
| pull_request: | ||
| types: [opened, reopened, ready_for_review, synchronize] | ||
| # branches: [master, main] |
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.
Replaces separate codeql-full-scan.yml and codeql-pr-scan.yml with a single unified codeql.yml workflow.