Skip to content

Commit 465f39d

Browse files
committed
feat: skip draft and unaffected-language analysis
1 parent 63d3d63 commit 465f39d

14 files changed

Lines changed: 1081 additions & 78 deletions

‎analyze/action.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ outputs:
9393
description: Absolute, local path to the directory containing the generated SARIF file.
9494
sarif-id:
9595
description: The ID of the uploaded SARIF file.
96+
analysis-skipped:
97+
description: Whether analysis was intentionally skipped before CodeQL finalization
98+
analysis-skip-reason:
99+
description: Why analysis was intentionally skipped, if applicable
96100
runs:
97101
using: node24
98102
main: "../lib/analyze-entry.js"

‎init/action.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ inputs:
2929
For more information, see
3030
https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#changing-the-languages-that-are-analyzed.
3131
required: false
32+
skip-if-draft:
33+
description: >-
34+
When true and the current event confirms this is a draft pull request, skip CodeQL before
35+
downloading tools or initializing a database. The workflow must run again on `ready_for_review`
36+
to analyze the PR once it is marked ready. For a `dynamic` workflow, the workflow generator can
37+
set `CODE_SCANNING_IS_DRAFT=true` to trigger the same early skip. If draft state is unavailable,
38+
analysis continues.
39+
required: false
40+
default: 'false'
41+
skip-if-no-language-changes:
42+
description: >-
43+
When true for a single explicitly requested built-in language, skip CodeQL before tool download
44+
and database initialization if the complete pull-request diff contains no relevant source or
45+
language configuration files. Unknown, incomplete, or unrecognized diffs fail open and run the
46+
full analysis. This uses the complete language database when relevant changes exist; it does
47+
not restrict analysis to changed files.
48+
required: false
49+
default: 'false'
3250
build-mode:
3351
description: >-
3452
The build mode that will be used to analyze the language. This input is only available when
@@ -176,6 +194,10 @@ outputs:
176194
description: The path of the CodeQL binary used for analysis
177195
codeql-version:
178196
description: The version of the CodeQL binary used for analysis
197+
analysis-skipped:
198+
description: Whether analysis was intentionally skipped before CodeQL initialization
199+
analysis-skip-reason:
200+
description: Why analysis was intentionally skipped, if applicable
179201
runs:
180202
using: node24
181203
main: '../lib/init-entry.js'

0 commit comments

Comments
 (0)