Skip to content

Commit

Permalink
Avoid sending status reports in test mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aeisenberg committed Feb 1, 2022
1 parent e9aa2c6 commit 0dd07df
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/actions-util.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/actions-util.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/upload-lib.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/upload-lib.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/actions-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,12 @@ export async function sendStatusReport<S extends StatusReportBase>(
): Promise<boolean> {
const statusReportJSON = JSON.stringify(statusReport);
core.debug(`Sending status report: ${statusReportJSON}`);
// If in test mode we don't want to upload the results
const testMode = process.env["TEST_MODE"] === "true" || false;
if (testMode) {
core.debug("In test mode. Status reports are not uploaded.");
return true;
}

const nwo = getRequiredEnvParam("GITHUB_REPOSITORY");
const [owner, repo] = nwo.split("/");
Expand Down
1 change: 1 addition & 0 deletions src/upload-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ async function uploadPayload(
// If in test mode we don't want to upload the results
const testMode = process.env["TEST_MODE"] === "true" || false;
if (testMode) {
logger.debug("In test mode. Results are not uploaded.");
return;
}

Expand Down

0 comments on commit 0dd07df

Please sign in to comment.