Add test mode
This commit is contained in:
parent
baa9c9e0df
commit
c979850d28
3 changed files with 16 additions and 2 deletions
7
.github/workflows/integration-testing.yml
vendored
7
.github/workflows/integration-testing.yml
vendored
|
|
@ -22,7 +22,8 @@ jobs:
|
|||
shell: bash
|
||||
run: ./build.sh
|
||||
- uses: ./../action/analyze
|
||||
|
||||
env:
|
||||
TEST_MODE: true
|
||||
|
||||
multi-language-repo/test-custom-queries:
|
||||
strategy:
|
||||
|
|
@ -45,4 +46,6 @@ jobs:
|
|||
- name: Build code
|
||||
shell: bash
|
||||
run: ./build.sh
|
||||
- uses: ./../action/analyze
|
||||
- uses: ./../action/analyze
|
||||
env:
|
||||
TEST_MODE: true
|
||||
5
lib/upload-lib.js
generated
5
lib/upload-lib.js
generated
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue