Skip to content

ci(PRODSEC-343): consolidate CodeQL workflows into single unified scan - #3

Open
anguprasad07 wants to merge 1 commit into
mainfrom
PRODSEC-343/consolidate-codeql
Open

ci(PRODSEC-343): consolidate CodeQL workflows into single unified scan#3
anguprasad07 wants to merge 1 commit into
mainfrom
PRODSEC-343/consolidate-codeql

Conversation

@anguprasad07

Copy link
Copy Markdown

Replaces separate codeql-full-scan.yml and codeql-pr-scan.yml with a single unified codeql.yml workflow.

Copilot AI review requested due to automatic review settings May 14, 2026 17:39

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 reviewed 1 out of 1 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

.github/workflows/codeql.yml:28

  • inputs.ref is only populated for workflow_dispatch (and workflow_call) events; for schedule and pull_request events the inputs context yields an empty/null value. The || '' fallback is therefore effectively a no-op, since inputs.ref is already empty in those cases. More importantly, passing an empty string for ref on PR runs may be misinterpreted by the reusable workflow depending on how it handles a blank ref input — verify that codeql-scan.yml@master correctly checks out the PR head when ref is empty, otherwise the scanned code may not match the PR.
      ref: ${{ inputs.ref || '' }}

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

@@ -0,0 +1,37 @@
name: "CodeQL"
Comment on lines +12 to +14
pull_request:
types: [opened, reopened, ready_for_review, synchronize]
# branches: [master, main]

# Cancel in-progress PR scans when new commits arrive; never cancel full scans.
concurrency:
group: codeql-unified-${{ github.repository }}-${{ github.ref }}
# 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 +26 to +37
uses: KeepTruckin/security-scanners/.github/workflows/codeql-scan.yml@master
with:
ref: ${{ inputs.ref || '' }}
# 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' }}
secrets: inherit
permissions:
security-events: write
contents: read
actions: read
packages: read

@ktbot ktbot 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.

Approved PRODSEC-343 CodeQL workflow consolidation.

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