Add test mode

This commit is contained in:
David Verdeguer 2020-05-08 16:06:35 +02:00
parent baa9c9e0df
commit c979850d28
3 changed files with 16 additions and 2 deletions

5
lib/upload-lib.js generated
View file

@ -58,6 +58,11 @@ exports.combineSarifFiles = combineSarifFiles;
// If the request fails then this will retry a small number of times.
async function uploadPayload(payload) {
core.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) {
return true;
}
const githubToken = core.getInput('token');
const ph = new auth.BearerCredentialHandler(githubToken);
const client = new http.HttpClient('Code Scanning : Upload SARIF', [ph]);