From d61a6fa793c84c98e08555552b4b9c6374665d24 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 3 Dec 2025 12:05:17 +0000 Subject: [PATCH] Update CLI config test to account for overlay db changes on PRs --- .github/workflows/codescanning-config-cli.yml | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codescanning-config-cli.yml b/.github/workflows/codescanning-config-cli.yml index 3c97239d5..2f4b67cc1 100644 --- a/.github/workflows/codescanning-config-cli.yml +++ b/.github/workflows/codescanning-config-cli.yml @@ -70,13 +70,33 @@ jobs: with: version: ${{ matrix.version }} - - name: Empty file + # On PRs, overlay analysis may change the config that is passed to the CLI. + # Therefore, we have two variants of the following test, one for PRs and one for other events. + - name: Empty file (non-PR) + if: github.event_name != 'pull_request' uses: ./../action/.github/actions/check-codescanning-config with: expected-config-file-contents: "{}" languages: javascript tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Empty file (PR) + if: github.event_name == 'pull_request' + uses: ./../action/.github/actions/check-codescanning-config + with: + expected-config-file-contents: | + { + "query-filters": [ + { + "exclude": { + "tags": "exclude-from-incremental" + } + } + ] + } + languages: javascript + tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Packs from input if: success() || failure() uses: ./../action/.github/actions/check-codescanning-config