Skip to content

Commit a21bb7f

Browse files
Update upload input values and logic (#1598)
- The `upload` input to the `analyze` Action now accepts the following values: - `always` is the default value, which uploads the SARIF file to Code Scanning for successful and failed runs. - `failure-only` is recommended for customers post-processing the SARIF file before uploading it to Code Scanning. This option uploads debugging information to Code Scanning for failed runs to improve the debugging experience. - `never` avoids uploading the SARIF file to Code Scanning even if the code scanning run fails. This is not recommended for external users since it complicates debugging. - The legacy `true` and `false` options will be interpreted as `always` and `failure-only` respectively. --------- Co-authored-by: Henry Mercer <[email protected]>
1 parent 0214d1d commit a21bb7f

25 files changed

+206
-89
lines changed

.github/query-filter-test/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ runs:
4040
with:
4141
output: ${{ runner.temp }}/results
4242
upload-database: false
43-
upload: false
43+
upload: never
4444
env:
4545
CODEQL_ACTION_TEST_MODE: "true"
4646
- name: Check SARIF

.github/workflows/__javascript-source-root.yml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__upload-ref-sha-input.yml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/__with-checkout-path.yml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/expected-queries-runs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
with:
3737
output: ${{ runner.temp }}/results
3838
upload-database: false
39-
upload: false
39+
upload: never
4040

4141
- name: Check Sarif
4242
uses: ./../action/.github/check-sarif

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ No user facing changes.
77
## 2.2.8 - 22 Mar 2023
88

99
- Update default CodeQL bundle version to 2.12.5. [#1585](https://github.com/github/codeql-action/pull/1585)
10+
- Customers post-processing the SARIF output of the `analyze` Action before uploading it to Code Scanning will benefit from an improved debugging experience. [#1598](https://github.com/github/codeql-action/pull/1598)
11+
- The CodeQL Action will now upload a SARIF file with debugging information to Code Scanning on failed runs for customers using `upload: false`. Previously, this was only available for customers using the default value of the `upload` input.
12+
- The `upload` input to the `analyze` Action now accepts the following values:
13+
- `always` is the default value, which uploads the SARIF file to Code Scanning for successful and failed runs.
14+
- `failure-only` is recommended for customers post-processing the SARIF file before uploading it to Code Scanning. This option uploads debugging information to Code Scanning for failed runs to improve the debugging experience.
15+
- `never` avoids uploading the SARIF file to Code Scanning even if the code scanning run fails. This is not recommended for external users since it complicates debugging.
16+
- The legacy `true` and `false` options will be interpreted as `always` and `failure-only` respectively.
1017

1118
## 2.2.7 - 15 Mar 2023
1219

analyze/action.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ inputs:
1010
required: false
1111
default: "../results"
1212
upload:
13-
description: Upload the SARIF file to Code Scanning
13+
description: >-
14+
Upload the SARIF file to Code Scanning.
15+
Defaults to 'always' which uploads the SARIF file to Code Scanning for successful and failed runs.
16+
'failure-only' only uploads debugging information to Code Scanning if the workflow run fails, for users post-processing the SARIF file before uploading it to Code Scanning.
17+
'never' avoids uploading the SARIF file to Code Scanning, even if the code scanning run fails. This is not recommended for external users since it complicates debugging.
1418
required: false
1519
# If changing this, make sure to update workflow.ts accordingly.
16-
default: "true"
20+
default: "always"
1721
cleanup-level:
1822
description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup' as documented at https://codeql.github.com/docs/codeql-cli/manual/database-cleanup"
1923
required: false

lib/actions-util.js

+19-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/actions-util.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)