mirror of
https://github.com/github/codeql-action.git
synced 2025-12-06 07:48:17 +08:00
Add workflow input to disable uploads
This commit is contained in:
@@ -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:
|
||||
|
||||
4
lib/analyze-action.js
generated
4
lib/analyze-action.js
generated
@@ -34,6 +34,10 @@ async function sendStatusReport(startedAt, stats, error) {
|
||||
await actionsUtil.sendStatusReport(statusReport);
|
||||
}
|
||||
async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
||||
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.");
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user