Skip to content

Commit f3cd5fa

Browse files
Add workflow input to disable uploads
1 parent 33ac512 commit f3cd5fa

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

analyze/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ inputs:
3434
category:
3535
description: String used by Code Scanning for matching the analyses
3636
required: false
37+
upload-database:
38+
description: Whether to upload the resulting CodeQL database
39+
required: false
40+
default: "true"
3741
token:
3842
default: ${{ github.token }}
3943
matrix:

lib/analyze-action.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze-action.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ async function uploadDatabases(
5858
apiDetails: GitHubApiDetails,
5959
logger: Logger
6060
): Promise<void> {
61+
if (actionsUtil.getRequiredInput("upload-database") !== "true") {
62+
logger.debug("Database upload disabled in workflow. Skipping upload.");
63+
return;
64+
}
65+
6166
// Do nothing when not running against github.com
6267
if (config.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
6368
logger.debug("Not running against github.com. Skipping upload.");

0 commit comments

Comments
 (0)