Only attempt to upload on dotcom

This commit is contained in:
Robert 2021-06-16 17:24:26 +01:00
parent 366b68eda0
commit b985a67b97
3 changed files with 12 additions and 1 deletions

5
lib/analyze-action.js generated
View file

@ -34,6 +34,11 @@ async function sendStatusReport(startedAt, stats, error) {
await actionsUtil.sendStatusReport(statusReport);
}
async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
// Do nothing when not running against github.com
if (config.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
logger.debug("Not running against github.com. Skipping upload.");
return;
}
if (!(await actionsUtil.isAnalyzingDefaultBranch())) {
// We only want to upload a database if we are analyzing the default branch.
logger.debug("Not analyzing default branch. Skipping upload.");

File diff suppressed because one or more lines are too long

View file

@ -58,6 +58,12 @@ async function uploadDatabases(
apiDetails: GitHubApiDetails,
logger: Logger
): Promise<void> {
// Do nothing when not running against github.com
if (config.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
logger.debug("Not running against github.com. Skipping upload.");
return;
}
if (!(await actionsUtil.isAnalyzingDefaultBranch())) {
// We only want to upload a database if we are analyzing the default branch.
logger.debug("Not analyzing default branch. Skipping upload.");