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

View file

@ -52,6 +52,12 @@ export function combineSarifFiles(sarifFiles: string[]): string {
async function uploadPayload(payload): Promise<boolean> {
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: auth.BearerCredentialHandler = new auth.BearerCredentialHandler(githubToken);
const client = new http.HttpClient('Code Scanning : Upload SARIF', [ph]);