mirror of
https://github.com/github/codeql-action.git
synced 2025-12-23 15:50:11 +08:00
Factor out test mode determination code
This commit is contained in:
3
lib/upload-lib.js
generated
3
lib/upload-lib.js
generated
@@ -93,8 +93,7 @@ function getAutomationID(category, analysis_key, environment) {
|
||||
async function uploadPayload(payload, repositoryNwo, apiDetails, logger) {
|
||||
logger.info("Uploading results");
|
||||
// If in test mode we don't want to upload the results
|
||||
const testMode = process.env["TEST_MODE"] === "true" || false;
|
||||
if (testMode) {
|
||||
if (util.isInTestMode()) {
|
||||
const payloadSaveFile = path.join(actionsUtil.getTemporaryDirectory(), "payload.json");
|
||||
logger.info(`In test mode. Results are not uploaded. Saving to ${payloadSaveFile}`);
|
||||
logger.info(`Payload: ${JSON.stringify(payload, null, 2)}`);
|
||||
|
||||
Reference in New Issue
Block a user