From 12243c759f6b03e25f9fc38ece10cb0f862df590 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 11 Jun 2024 19:07:13 +0100 Subject: [PATCH] Disable database upload in test mode --- .github/actions/query-filter-test/action.yml | 1 - .github/workflows/__all-platform-bundle.yml | 2 -- .github/workflows/__analyze-ref-input.yml | 1 - .github/workflows/__autobuild-action.yml | 2 -- .github/workflows/__go-custom-queries.yml | 2 -- .github/workflows/__go-indirect-tracing-workaround.yml | 2 -- .github/workflows/__go-tracing-autobuilder.yml | 2 -- .github/workflows/__go-tracing-custom-build-steps.yml | 2 -- .github/workflows/__go-tracing-legacy-workflow.yml | 2 -- .github/workflows/__javascript-source-root.yml | 2 -- .github/workflows/__test-autobuild-working-dir.yml | 2 -- .github/workflows/__test-local-codeql.yml | 2 -- .github/workflows/__test-proxy.yml | 2 -- .github/workflows/__upload-ref-sha-input.yml | 2 -- .github/workflows/__with-checkout-path.yml | 2 -- .github/workflows/expected-queries-runs.yml | 2 -- .github/workflows/python312-windows.yml | 5 ++--- .github/workflows/test-codeql-bundle-all.yml | 2 -- lib/database-upload.js | 4 ++++ lib/database-upload.js.map | 2 +- pr-checks/checks/all-platform-bundle.yml | 2 -- pr-checks/checks/analyze-ref-input.yml | 1 - pr-checks/checks/autobuild-action.yml | 2 -- pr-checks/checks/go-custom-queries.yml | 2 -- pr-checks/checks/go-indirect-tracing-workaround.yml | 2 -- pr-checks/checks/go-tracing-autobuilder.yml | 2 -- pr-checks/checks/go-tracing-custom-build-steps.yml | 2 -- pr-checks/checks/go-tracing-legacy-workflow.yml | 2 -- pr-checks/checks/javascript-source-root.yml | 2 -- pr-checks/checks/test-autobuild-working-dir.yml | 2 -- pr-checks/checks/test-local-codeql.yml | 2 -- pr-checks/checks/test-proxy.yml | 2 -- pr-checks/checks/upload-ref-sha-input.yml | 2 -- pr-checks/checks/with-checkout-path.yml | 2 -- src/database-upload.ts | 5 +++++ 35 files changed, 12 insertions(+), 63 deletions(-) diff --git a/.github/actions/query-filter-test/action.yml b/.github/actions/query-filter-test/action.yml index 9e354fbd4..f1dfc38bf 100644 --- a/.github/actions/query-filter-test/action.yml +++ b/.github/actions/query-filter-test/action.yml @@ -48,7 +48,6 @@ runs: - uses: ./../action/analyze with: output: ${{ runner.temp }}/results - upload-database: false upload: never env: CODEQL_ACTION_TEST_MODE: "true" diff --git a/.github/workflows/__all-platform-bundle.yml b/.github/workflows/__all-platform-bundle.yml index 8f79729e9..bb7e2060c 100644 --- a/.github/workflows/__all-platform-bundle.yml +++ b/.github/workflows/__all-platform-bundle.yml @@ -68,7 +68,5 @@ jobs: shell: bash run: ./build.sh - uses: ./../action/analyze - with: - upload-database: false env: CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__analyze-ref-input.yml b/.github/workflows/__analyze-ref-input.yml index 5326cf786..753bfadce 100644 --- a/.github/workflows/__analyze-ref-input.yml +++ b/.github/workflows/__analyze-ref-input.yml @@ -72,7 +72,6 @@ jobs: run: ./build.sh - uses: ./../action/analyze with: - upload-database: false ref: refs/heads/main sha: 5e235361806c361d4d3f8859e3c897658025a9a2 env: diff --git a/.github/workflows/__autobuild-action.yml b/.github/workflows/__autobuild-action.yml index 2b9ab0e04..d36e55697 100644 --- a/.github/workflows/__autobuild-action.yml +++ b/.github/workflows/__autobuild-action.yml @@ -75,8 +75,6 @@ jobs: CORECLR_PROFILER: '' CORECLR_PROFILER_PATH_64: '' - uses: ./../action/analyze - with: - upload-database: false - name: Check database shell: bash run: | diff --git a/.github/workflows/__go-custom-queries.yml b/.github/workflows/__go-custom-queries.yml index ba9f41f8d..d685e2678 100644 --- a/.github/workflows/__go-custom-queries.yml +++ b/.github/workflows/__go-custom-queries.yml @@ -115,8 +115,6 @@ jobs: shell: bash run: ./build.sh - uses: ./../action/analyze - with: - upload-database: false env: DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml index e13b41ae8..9e7cc857e 100644 --- a/.github/workflows/__go-indirect-tracing-workaround.yml +++ b/.github/workflows/__go-indirect-tracing-workaround.yml @@ -69,8 +69,6 @@ jobs: shell: bash run: go build main.go - uses: ./../action/analyze - with: - upload-database: false - shell: bash run: | if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml index ed68f57ee..2b047fb88 100644 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ b/.github/workflows/__go-tracing-autobuilder.yml @@ -99,8 +99,6 @@ jobs: tools: ${{ steps.prepare-test.outputs.tools-url }} - uses: ./../action/autobuild - uses: ./../action/analyze - with: - upload-database: false - shell: bash run: | if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml index 08973e050..f89a52711 100644 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ b/.github/workflows/__go-tracing-custom-build-steps.yml @@ -101,8 +101,6 @@ jobs: shell: bash run: go build main.go - uses: ./../action/analyze - with: - upload-database: false - shell: bash run: | # Once we start running Bash 4.2 in all environments, we can replace the diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml index 83f77de0c..c3cb578a2 100644 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ b/.github/workflows/__go-tracing-legacy-workflow.yml @@ -98,8 +98,6 @@ jobs: languages: go tools: ${{ steps.prepare-test.outputs.tools-url }} - uses: ./../action/analyze - with: - upload-database: false - shell: bash run: | cd "$RUNNER_TEMP/codeql_databases" diff --git a/.github/workflows/__javascript-source-root.yml b/.github/workflows/__javascript-source-root.yml index fd217d834..e0bf8f234 100644 --- a/.github/workflows/__javascript-source-root.yml +++ b/.github/workflows/__javascript-source-root.yml @@ -73,9 +73,7 @@ jobs: tools: ${{ steps.prepare-test.outputs.tools-url }} - uses: ./../action/analyze with: - upload-database: false skip-queries: true - upload: never - name: Assert database exists shell: bash run: | diff --git a/.github/workflows/__test-autobuild-working-dir.yml b/.github/workflows/__test-autobuild-working-dir.yml index 107830efe..f2736bfad 100644 --- a/.github/workflows/__test-autobuild-working-dir.yml +++ b/.github/workflows/__test-autobuild-working-dir.yml @@ -72,8 +72,6 @@ jobs: with: working-directory: autobuild-dir - uses: ./../action/analyze - with: - upload-database: false - name: Check database shell: bash run: | diff --git a/.github/workflows/__test-local-codeql.yml b/.github/workflows/__test-local-codeql.yml index 2f045b7aa..a3af1d691 100644 --- a/.github/workflows/__test-local-codeql.yml +++ b/.github/workflows/__test-local-codeql.yml @@ -74,7 +74,5 @@ jobs: shell: bash run: ./build.sh - uses: ./../action/analyze - with: - upload-database: false env: CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__test-proxy.yml b/.github/workflows/__test-proxy.yml index 80b5f4a93..2cdbf3a5e 100644 --- a/.github/workflows/__test-proxy.yml +++ b/.github/workflows/__test-proxy.yml @@ -62,8 +62,6 @@ jobs: languages: javascript tools: ${{ steps.prepare-test.outputs.tools-url }} - uses: ./../action/analyze - with: - upload-database: false env: https_proxy: http://squid-proxy:3128 CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__upload-ref-sha-input.yml b/.github/workflows/__upload-ref-sha-input.yml index 1eb626750..8b6a5c638 100644 --- a/.github/workflows/__upload-ref-sha-input.yml +++ b/.github/workflows/__upload-ref-sha-input.yml @@ -72,10 +72,8 @@ jobs: run: ./build.sh - uses: ./../action/analyze with: - upload-database: false ref: refs/heads/main sha: 5e235361806c361d4d3f8859e3c897658025a9a2 - upload: never - uses: ./../action/upload-sarif with: ref: refs/heads/main diff --git a/.github/workflows/__with-checkout-path.yml b/.github/workflows/__with-checkout-path.yml index 22d40f625..5e5c07948 100644 --- a/.github/workflows/__with-checkout-path.yml +++ b/.github/workflows/__with-checkout-path.yml @@ -93,8 +93,6 @@ jobs: checkout_path: x/y/z/some-path/tests/multi-language-repo ref: v1.1.0 sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6 - upload: never - upload-database: false - uses: ./../action/upload-sarif with: diff --git a/.github/workflows/expected-queries-runs.yml b/.github/workflows/expected-queries-runs.yml index 9d7443426..f83d0711e 100644 --- a/.github/workflows/expected-queries-runs.yml +++ b/.github/workflows/expected-queries-runs.yml @@ -37,8 +37,6 @@ jobs: - uses: ./../action/analyze with: output: ${{ runner.temp }}/results - upload-database: false - upload: never - name: Check Sarif uses: ./../action/.github/actions/check-sarif diff --git a/.github/workflows/python312-windows.yml b/.github/workflows/python312-windows.yml index bee51dfa6..da5226dc2 100644 --- a/.github/workflows/python312-windows.yml +++ b/.github/workflows/python312-windows.yml @@ -14,6 +14,8 @@ on: jobs: test-setup-python-scripts: + env: + CODEQL_ACTION_TEST_MODE: true timeout-minutes: 45 runs-on: windows-latest @@ -37,6 +39,3 @@ jobs: - name: Analyze uses: ./../action/analyze - with: - upload: false - upload-database: false diff --git a/.github/workflows/test-codeql-bundle-all.yml b/.github/workflows/test-codeql-bundle-all.yml index f8e9585ab..0f1f6a06f 100644 --- a/.github/workflows/test-codeql-bundle-all.yml +++ b/.github/workflows/test-codeql-bundle-all.yml @@ -53,7 +53,5 @@ jobs: shell: bash run: ./build.sh - uses: ./../action/analyze - with: - upload-database: false env: CODEQL_ACTION_TEST_MODE: true diff --git a/lib/database-upload.js b/lib/database-upload.js index f6293a485..28377f622 100644 --- a/lib/database-upload.js +++ b/lib/database-upload.js @@ -35,6 +35,10 @@ async function uploadDatabases(repositoryNwo, config, apiDetails, logger) { logger.debug("Database upload disabled in workflow. Skipping upload."); return; } + if (util.isInTestMode()) { + logger.debug("In test mode. Skipping database upload."); + return; + } // Do nothing when not running against github.com if (config.gitHubVersion.type !== util.GitHubVariant.DOTCOM && config.gitHubVersion.type !== util.GitHubVariant.GHE_DOTCOM) { diff --git a/lib/database-upload.js.map b/lib/database-upload.js.map index d5dbffbbe..a31a9dff6 100644 --- a/lib/database-upload.js.map +++ b/lib/database-upload.js.map @@ -1 +1 @@ -{"version":3,"file":"database-upload.js","sourceRoot":"","sources":["../src/database-upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEzB,4DAA8C;AAC9C,6CAA8D;AAC9D,qCAAqC;AAIrC,6CAA+B;AAC/B,iCAAkD;AAE3C,KAAK,UAAU,eAAe,CACnC,aAA4B,EAC5B,MAAc,EACd,UAA4B,EAC5B,MAAc;IAEd,IAAI,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,MAAM,EAAE,CAAC;QAC/D,MAAM,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACvE,OAAO;IACT,CAAC;IAED,iDAAiD;IACjD,IACE,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,MAAM;QACvD,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,UAAU,EAC3D,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,wBAAwB,EAAE,CAAC,EAAE,CAAC;QACpD,4EAA4E;QAC5E,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAC/D,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,IAAA,yBAAY,GAAE,CAAC;IAC9B,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAEjD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,IAAA,qBAAc,EAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3D,UAAU,CAAC,QAAQ,GAAG,WAAW,UAAU,CAAC,QAAQ,EAAE,CAAC;IAEvD,4DAA4D;IAC5D,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BACT,mBAAmB,CAAC,KAAK,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACf,4CAA4C;YAC5C,MAAM,CAAC,OAAO,CAAC,iCAAiC,QAAQ,KAAK,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;AACH,CAAC;AA/ED,0CA+EC"} \ No newline at end of file +{"version":3,"file":"database-upload.js","sourceRoot":"","sources":["../src/database-upload.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAEzB,4DAA8C;AAC9C,6CAA8D;AAC9D,qCAAqC;AAIrC,6CAA+B;AAC/B,iCAAkD;AAE3C,KAAK,UAAU,eAAe,CACnC,aAA4B,EAC5B,MAAc,EACd,UAA4B,EAC5B,MAAc;IAEd,IAAI,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,KAAK,MAAM,EAAE,CAAC;QAC/D,MAAM,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;QACvE,OAAO;IACT,CAAC;IAED,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACxB,MAAM,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QACxD,OAAO;IACT,CAAC;IAED,iDAAiD;IACjD,IACE,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,MAAM;QACvD,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,aAAa,CAAC,UAAU,EAC3D,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,IAAI,CAAC,CAAC,MAAM,WAAW,CAAC,wBAAwB,EAAE,CAAC,EAAE,CAAC;QACpD,4EAA4E;QAC5E,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAC/D,OAAO;IACT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BACR,IAAI,EAAE,GAAG,QAAQ,WAAW;oBAC5B,UAAU,EAAE,SAAS;oBACrB,IAAI,EAAE,mBAAmB;oBACzB,OAAO,EAAE;wBACP,aAAa,EAAE,SAAS,UAAU,CAAC,IAAI,EAAE;wBACzC,cAAc,EAAE,iBAAiB;wBACjC,gBAAgB,EAAE,aAAa;qBAChC;iBACF,CACF,CAAC;gBACF,MAAM,CAAC,KAAK,CAAC,sCAAsC,QAAQ,EAAE,CAAC,CAAC;YACjE,CAAC;oBAAS,CAAC;gBACT,mBAAmB,CAAC,KAAK,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACf,4CAA4C;YAC5C,MAAM,CAAC,OAAO,CAAC,iCAAiC,QAAQ,KAAK,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;AACH,CAAC;AApFD,0CAoFC"} \ No newline at end of file diff --git a/pr-checks/checks/all-platform-bundle.yml b/pr-checks/checks/all-platform-bundle.yml index b681ad616..52ef3e234 100644 --- a/pr-checks/checks/all-platform-bundle.yml +++ b/pr-checks/checks/all-platform-bundle.yml @@ -15,5 +15,3 @@ steps: shell: bash run: ./build.sh - uses: ./../action/analyze - with: - upload-database: false diff --git a/pr-checks/checks/analyze-ref-input.yml b/pr-checks/checks/analyze-ref-input.yml index 7bd309ef1..e790b8674 100644 --- a/pr-checks/checks/analyze-ref-input.yml +++ b/pr-checks/checks/analyze-ref-input.yml @@ -12,6 +12,5 @@ steps: run: ./build.sh - uses: ./../action/analyze with: - upload-database: false ref: 'refs/heads/main' sha: '5e235361806c361d4d3f8859e3c897658025a9a2' diff --git a/pr-checks/checks/autobuild-action.yml b/pr-checks/checks/autobuild-action.yml index 666e4a0dc..5e0c0ee2a 100644 --- a/pr-checks/checks/autobuild-action.yml +++ b/pr-checks/checks/autobuild-action.yml @@ -16,8 +16,6 @@ steps: CORECLR_PROFILER: "" CORECLR_PROFILER_PATH_64: "" - uses: ./../action/analyze - with: - upload-database: false - name: Check database shell: bash run: | diff --git a/pr-checks/checks/go-custom-queries.yml b/pr-checks/checks/go-custom-queries.yml index 44d6b7792..d7748760b 100644 --- a/pr-checks/checks/go-custom-queries.yml +++ b/pr-checks/checks/go-custom-queries.yml @@ -15,5 +15,3 @@ steps: shell: bash run: ./build.sh - uses: ./../action/analyze - with: - upload-database: false diff --git a/pr-checks/checks/go-indirect-tracing-workaround.yml b/pr-checks/checks/go-indirect-tracing-workaround.yml index a7b105788..14dfb3998 100644 --- a/pr-checks/checks/go-indirect-tracing-workaround.yml +++ b/pr-checks/checks/go-indirect-tracing-workaround.yml @@ -17,8 +17,6 @@ steps: shell: bash run: go build main.go - uses: ./../action/analyze - with: - upload-database: false - shell: bash run: | if [[ -z "${CODEQL_ACTION_GO_BINARY}" ]]; then diff --git a/pr-checks/checks/go-tracing-autobuilder.yml b/pr-checks/checks/go-tracing-autobuilder.yml index f5e5a963d..5a83c1585 100644 --- a/pr-checks/checks/go-tracing-autobuilder.yml +++ b/pr-checks/checks/go-tracing-autobuilder.yml @@ -16,8 +16,6 @@ steps: tools: ${{ steps.prepare-test.outputs.tools-url }} - uses: ./../action/autobuild - uses: ./../action/analyze - with: - upload-database: false - shell: bash run: | if [[ "${CODEQL_ACTION_DID_AUTOBUILD_GOLANG}" != true ]]; then diff --git a/pr-checks/checks/go-tracing-custom-build-steps.yml b/pr-checks/checks/go-tracing-custom-build-steps.yml index da0939f19..7113b64a3 100644 --- a/pr-checks/checks/go-tracing-custom-build-steps.yml +++ b/pr-checks/checks/go-tracing-custom-build-steps.yml @@ -16,8 +16,6 @@ steps: shell: bash run: go build main.go - uses: ./../action/analyze - with: - upload-database: false - shell: bash run: | # Once we start running Bash 4.2 in all environments, we can replace the diff --git a/pr-checks/checks/go-tracing-legacy-workflow.yml b/pr-checks/checks/go-tracing-legacy-workflow.yml index 203d77946..c6809827a 100644 --- a/pr-checks/checks/go-tracing-legacy-workflow.yml +++ b/pr-checks/checks/go-tracing-legacy-workflow.yml @@ -15,8 +15,6 @@ steps: languages: go tools: ${{ steps.prepare-test.outputs.tools-url }} - uses: ./../action/analyze - with: - upload-database: false - shell: bash run: | cd "$RUNNER_TEMP/codeql_databases" diff --git a/pr-checks/checks/javascript-source-root.yml b/pr-checks/checks/javascript-source-root.yml index 72ca9b249..cbbfa2aa9 100644 --- a/pr-checks/checks/javascript-source-root.yml +++ b/pr-checks/checks/javascript-source-root.yml @@ -15,9 +15,7 @@ steps: tools: ${{ steps.prepare-test.outputs.tools-url }} - uses: ./../action/analyze with: - upload-database: false skip-queries: true - upload: never - name: Assert database exists shell: bash run: | diff --git a/pr-checks/checks/test-autobuild-working-dir.yml b/pr-checks/checks/test-autobuild-working-dir.yml index 5f4cdc374..468c4f23e 100644 --- a/pr-checks/checks/test-autobuild-working-dir.yml +++ b/pr-checks/checks/test-autobuild-working-dir.yml @@ -18,8 +18,6 @@ steps: with: working-directory: autobuild-dir - uses: ./../action/analyze - with: - upload-database: false - name: Check database shell: bash run: | diff --git a/pr-checks/checks/test-local-codeql.yml b/pr-checks/checks/test-local-codeql.yml index 417c717dd..92a73a6f6 100644 --- a/pr-checks/checks/test-local-codeql.yml +++ b/pr-checks/checks/test-local-codeql.yml @@ -20,5 +20,3 @@ steps: shell: bash run: ./build.sh - uses: ./../action/analyze - with: - upload-database: false diff --git a/pr-checks/checks/test-proxy.yml b/pr-checks/checks/test-proxy.yml index d3f9f4ae5..d1c6209e2 100644 --- a/pr-checks/checks/test-proxy.yml +++ b/pr-checks/checks/test-proxy.yml @@ -18,5 +18,3 @@ steps: languages: javascript tools: ${{ steps.prepare-test.outputs.tools-url }} - uses: ./../action/analyze - with: - upload-database: false diff --git a/pr-checks/checks/upload-ref-sha-input.yml b/pr-checks/checks/upload-ref-sha-input.yml index ffd339b59..2d8cbc50e 100644 --- a/pr-checks/checks/upload-ref-sha-input.yml +++ b/pr-checks/checks/upload-ref-sha-input.yml @@ -12,10 +12,8 @@ steps: run: ./build.sh - uses: ./../action/analyze with: - upload-database: false ref: 'refs/heads/main' sha: '5e235361806c361d4d3f8859e3c897658025a9a2' - upload: never - uses: ./../action/upload-sarif with: ref: 'refs/heads/main' diff --git a/pr-checks/checks/with-checkout-path.yml b/pr-checks/checks/with-checkout-path.yml index 5930966a7..fb2694944 100644 --- a/pr-checks/checks/with-checkout-path.yml +++ b/pr-checks/checks/with-checkout-path.yml @@ -35,8 +35,6 @@ steps: checkout_path: x/y/z/some-path/tests/multi-language-repo ref: v1.1.0 sha: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6 - upload: never - upload-database: false - uses: ./../action/upload-sarif with: diff --git a/src/database-upload.ts b/src/database-upload.ts index 142fa0b2d..1763c6db9 100644 --- a/src/database-upload.ts +++ b/src/database-upload.ts @@ -20,6 +20,11 @@ export async function uploadDatabases( return; } + if (util.isInTestMode()) { + logger.debug("In test mode. Skipping database upload."); + return; + } + // Do nothing when not running against github.com if ( config.gitHubVersion.type !== util.GitHubVariant.DOTCOM &&