Skip to content

Commit 1da4ce5

Browse files
committed
Ensure stats get sent when not uploading results
#323 (comment)
1 parent 6de1b75 commit 1da4ce5

3 files changed

Lines changed: 24 additions & 22 deletions

File tree

lib/analyze-action.js

Lines changed: 6 additions & 4 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: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,25 @@ async function run() {
7979
logger
8080
);
8181

82-
if (actionsUtil.getRequiredInput("upload") !== "true") {
82+
if (actionsUtil.getRequiredInput("upload") === "true") {
83+
const uploadStats = await upload_lib.uploadFromActions(
84+
outputDir,
85+
parseRepositoryNwo(actionsUtil.getRequiredEnvParam("GITHUB_REPOSITORY")),
86+
await actionsUtil.getCommitOid(),
87+
await actionsUtil.getRef(),
88+
await actionsUtil.getAnalysisKey(),
89+
actionsUtil.getRequiredEnvParam("GITHUB_WORKFLOW"),
90+
actionsUtil.getWorkflowRunID(),
91+
actionsUtil.getRequiredInput("checkout_path"),
92+
actionsUtil.getRequiredInput("matrix"),
93+
apiDetails,
94+
logger
95+
);
96+
stats = { ...queriesStats, ...uploadStats };
97+
} else {
8398
logger.info("Not uploading results");
84-
return;
99+
stats = { ...queriesStats }
85100
}
86-
87-
const uploadStats = await upload_lib.uploadFromActions(
88-
outputDir,
89-
parseRepositoryNwo(actionsUtil.getRequiredEnvParam("GITHUB_REPOSITORY")),
90-
await actionsUtil.getCommitOid(),
91-
await actionsUtil.getRef(),
92-
await actionsUtil.getAnalysisKey(),
93-
actionsUtil.getRequiredEnvParam("GITHUB_WORKFLOW"),
94-
actionsUtil.getWorkflowRunID(),
95-
actionsUtil.getRequiredInput("checkout_path"),
96-
actionsUtil.getRequiredInput("matrix"),
97-
apiDetails,
98-
logger
99-
);
100-
stats = { ...queriesStats, ...uploadStats };
101101
} catch (error) {
102102
core.setFailed(error.message);
103103
console.log(error);

0 commit comments

Comments
 (0)