Fix test to be immune to running on Actions

This commit is contained in:
Robin Neatherway 2020-11-30 18:35:55 +00:00
parent 836cbe0784
commit d99e994194
5 changed files with 7 additions and 3 deletions

2
lib/upload-lib.js generated
View file

@ -142,7 +142,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo
if (process.env.GITHUB_EVENT_NAME === "pull_request" &&
process.env.GITHUB_EVENT_PATH) {
const githubEvent = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"));
payloadObj.base_ref = githubEvent.pull_request.base.ref;
payloadObj.base_ref = `refs/heads/$githubEvent.pull_request.base.ref`;
payloadObj.base_sha = githubEvent.pull_request.base.sha;
}
}