Skip to content

Commit

Permalink
Add workflow input to disable uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert committed Jun 18, 2021
1 parent 33ac512 commit f3cd5fa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions analyze/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ inputs:
category:
description: String used by Code Scanning for matching the analyses
required: false
upload-database:
description: Whether to upload the resulting CodeQL database
required: false
default: "true"
token:
default: ${{ github.token }}
matrix:
Expand Down
4 changes: 4 additions & 0 deletions lib/analyze-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/analyze-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ async function uploadDatabases(
apiDetails: GitHubApiDetails,
logger: Logger
): Promise<void> {
if (actionsUtil.getRequiredInput("upload-database") !== "true") {
logger.debug("Database upload disabled in workflow. Skipping upload.");
return;
}

// Do nothing when not running against github.com
if (config.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
logger.debug("Not running against github.com. Skipping upload.");
Expand Down

0 comments on commit f3cd5fa

Please sign in to comment.