diff --git a/.github/workflows/__all-platform-bundle.yml b/.github/workflows/__all-platform-bundle.yml index 1be5ba9a41..1be1d63758 100644 --- a/.github/workflows/__all-platform-bundle.yml +++ b/.github/workflows/__all-platform-bundle.yml @@ -25,34 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: all-platform-bundle-${{github.ref}}-${{inputs.go-version}}-${{inputs.dotnet-version}} + group: all-platform-bundle-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: all-platform-bundle: strategy: @@ -75,22 +75,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'true' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'true' + setup-kotlin: 'true' - id: init uses: ./../action/init with: diff --git a/.github/workflows/__analyze-ref-input.yml b/.github/workflows/__analyze-ref-input.yml index 671e5f57b8..9ad6c3ec7c 100644 --- a/.github/workflows/__analyze-ref-input.yml +++ b/.github/workflows/__analyze-ref-input.yml @@ -25,44 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: analyze-ref-input-${{github.ref}}-${{inputs.go-version}}-${{inputs.python-version}}-${{inputs.dotnet-version}} + group: analyze-ref-input-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: analyze-ref-input: strategy: @@ -81,27 +71,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install Python - if: matrix.version != 'nightly-latest' - uses: actions/setup-python@v6 - with: - python-version: ${{ inputs.python-version || '3.13' }} - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - uses: ./../action/init with: tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/__autobuild-action.yml b/.github/workflows/__autobuild-action.yml index ed5cf19379..7521614f2c 100644 --- a/.github/workflows/__autobuild-action.yml +++ b/.github/workflows/__autobuild-action.yml @@ -65,6 +65,10 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -72,10 +76,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install .NET - uses: actions/setup-dotnet@v5 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: languages: csharp diff --git a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml index 4a411ad1b6..8acd90253f 100644 --- a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml +++ b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml @@ -67,6 +67,11 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install Java + uses: actions/setup-java@v5 + with: + java-version: ${{ inputs.java-version || '17' }} + distribution: temurin - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -74,11 +79,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Java - uses: actions/setup-java@v5 - with: - java-version: ${{ inputs.java-version || '17' }} - distribution: temurin - name: Test setup run: | # Make sure that Gradle build succeeds in autobuild-dir ... diff --git a/.github/workflows/__build-mode-autobuild.yml b/.github/workflows/__build-mode-autobuild.yml index 2863793fdc..7619d45936 100644 --- a/.github/workflows/__build-mode-autobuild.yml +++ b/.github/workflows/__build-mode-autobuild.yml @@ -67,13 +67,6 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test - with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' - name: Install Java uses: actions/setup-java@v5 with: @@ -87,6 +80,13 @@ jobs: run: |- gh release download --repo mikefarah/yq --pattern "yq_windows_amd64.exe" "$YQ_VERSION" -O "$YQ_PATH/yq.exe" echo "$YQ_PATH" >> "$GITHUB_PATH" + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test + with: + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - name: Set up Java test repo configuration run: | mv * .github ../action/tests/multi-language-repo/ diff --git a/.github/workflows/__build-mode-manual.yml b/.github/workflows/__build-mode-manual.yml index b2723d64f9..93010fe636 100644 --- a/.github/workflows/__build-mode-manual.yml +++ b/.github/workflows/__build-mode-manual.yml @@ -25,34 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: build-mode-manual-${{github.ref}}-${{inputs.go-version}}-${{inputs.dotnet-version}} + group: build-mode-manual-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: build-mode-manual: strategy: @@ -71,22 +71,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - uses: ./../action/init id: init with: diff --git a/.github/workflows/__bundle-toolcache.yml b/.github/workflows/__bundle-toolcache.yml index 7b5e8d1399..7606475875 100644 --- a/.github/workflows/__bundle-toolcache.yml +++ b/.github/workflows/__bundle-toolcache.yml @@ -39,10 +39,10 @@ jobs: fail-fast: false matrix: include: - - os: macos-latest - version: linked - os: ubuntu-latest version: linked + - os: macos-latest + version: linked - os: windows-latest version: linked name: 'Bundle: Caching checks' diff --git a/.github/workflows/__bundle-zstd.yml b/.github/workflows/__bundle-zstd.yml index ede1e320cb..85e0695268 100644 --- a/.github/workflows/__bundle-zstd.yml +++ b/.github/workflows/__bundle-zstd.yml @@ -39,10 +39,10 @@ jobs: fail-fast: false matrix: include: - - os: macos-latest - version: linked - os: ubuntu-latest version: linked + - os: macos-latest + version: linked - os: windows-latest version: linked name: 'Bundle: Zstandard checks' diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index b376d77f07..359461007d 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -25,34 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: export-file-baseline-information-${{github.ref}}-${{inputs.go-version}}-${{inputs.dotnet-version}} + group: export-file-baseline-information-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: export-file-baseline-information: strategy: @@ -75,22 +75,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - uses: ./../action/init id: init with: diff --git a/.github/workflows/__go-custom-queries.yml b/.github/workflows/__go-custom-queries.yml index f7d5a99f3b..cc11dc941d 100644 --- a/.github/workflows/__go-custom-queries.yml +++ b/.github/workflows/__go-custom-queries.yml @@ -25,34 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: go-custom-queries-${{github.ref}}-${{inputs.go-version}}-${{inputs.dotnet-version}} + group: go-custom-queries-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: go-custom-queries: strategy: @@ -73,22 +73,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - uses: ./../action/init with: languages: go diff --git a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml index 11497389f9..e474e1b6f5 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml @@ -61,6 +61,11 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -68,11 +73,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - uses: ./../action/init with: languages: go diff --git a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml index 7d83904e69..cc94d3bb8a 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml @@ -61,6 +61,11 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -68,11 +73,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - name: Remove `file` program run: | echo $(which file) diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml index 1259e7fa61..6c8a24e0c9 100644 --- a/.github/workflows/__go-indirect-tracing-workaround.yml +++ b/.github/workflows/__go-indirect-tracing-workaround.yml @@ -61,6 +61,11 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -68,11 +73,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - uses: ./../action/init with: languages: go diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml index 4a6dc68e2d..f014d2cf68 100644 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ b/.github/workflows/__go-tracing-autobuilder.yml @@ -51,32 +51,18 @@ jobs: include: - os: ubuntu-latest version: stable-v2.17.6 - - os: macos-latest - version: stable-v2.17.6 - os: ubuntu-latest version: stable-v2.18.4 - - os: macos-latest - version: stable-v2.18.4 - os: ubuntu-latest version: stable-v2.19.4 - - os: macos-latest - version: stable-v2.19.4 - os: ubuntu-latest version: stable-v2.20.7 - - os: macos-latest - version: stable-v2.20.7 - os: ubuntu-latest version: stable-v2.21.4 - - os: macos-latest - version: stable-v2.21.4 - os: ubuntu-latest version: stable-v2.22.4 - - os: macos-latest - version: stable-v2.22.4 - os: ubuntu-latest version: default - - os: macos-latest - version: default - os: ubuntu-latest version: linked - os: macos-latest @@ -95,6 +81,11 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -102,11 +93,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - uses: ./../action/init with: languages: go diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml index 5576b561c5..4b4782572b 100644 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ b/.github/workflows/__go-tracing-custom-build-steps.yml @@ -51,32 +51,18 @@ jobs: include: - os: ubuntu-latest version: stable-v2.17.6 - - os: macos-latest - version: stable-v2.17.6 - os: ubuntu-latest version: stable-v2.18.4 - - os: macos-latest - version: stable-v2.18.4 - os: ubuntu-latest version: stable-v2.19.4 - - os: macos-latest - version: stable-v2.19.4 - os: ubuntu-latest version: stable-v2.20.7 - - os: macos-latest - version: stable-v2.20.7 - os: ubuntu-latest version: stable-v2.21.4 - - os: macos-latest - version: stable-v2.21.4 - os: ubuntu-latest version: stable-v2.22.4 - - os: macos-latest - version: stable-v2.22.4 - os: ubuntu-latest version: default - - os: macos-latest - version: default - os: ubuntu-latest version: linked - os: macos-latest @@ -95,6 +81,11 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -102,11 +93,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - uses: ./../action/init with: languages: go diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml index 3a85caeb01..101ad8024d 100644 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ b/.github/workflows/__go-tracing-legacy-workflow.yml @@ -51,32 +51,18 @@ jobs: include: - os: ubuntu-latest version: stable-v2.17.6 - - os: macos-latest - version: stable-v2.17.6 - os: ubuntu-latest version: stable-v2.18.4 - - os: macos-latest - version: stable-v2.18.4 - os: ubuntu-latest version: stable-v2.19.4 - - os: macos-latest - version: stable-v2.19.4 - os: ubuntu-latest version: stable-v2.20.7 - - os: macos-latest - version: stable-v2.20.7 - os: ubuntu-latest version: stable-v2.21.4 - - os: macos-latest - version: stable-v2.21.4 - os: ubuntu-latest version: stable-v2.22.4 - - os: macos-latest - version: stable-v2.22.4 - os: ubuntu-latest version: default - - os: macos-latest - version: default - os: ubuntu-latest version: linked - os: macos-latest @@ -95,6 +81,11 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -102,11 +93,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - uses: ./../action/init with: languages: go diff --git a/.github/workflows/__go.yml b/.github/workflows/__go.yml index 76d178b723..3688dc6fd8 100644 --- a/.github/workflows/__go.yml +++ b/.github/workflows/__go.yml @@ -10,16 +10,16 @@ env: on: workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' jobs: go-custom-queries: name: 'Go: Custom queries' @@ -28,8 +28,8 @@ jobs: security-events: read uses: ./.github/workflows/__go-custom-queries.yml with: - go-version: ${{ inputs.go-version }} dotnet-version: ${{ inputs.dotnet-version }} + go-version: ${{ inputs.go-version }} go-indirect-tracing-workaround-diagnostic: name: 'Go: diagnostic when Go is changed after init step' permissions: diff --git a/.github/workflows/__local-bundle.yml b/.github/workflows/__local-bundle.yml index ae77983001..50eb333492 100644 --- a/.github/workflows/__local-bundle.yml +++ b/.github/workflows/__local-bundle.yml @@ -25,44 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: local-bundle-${{github.ref}}-${{inputs.go-version}}-${{inputs.python-version}}-${{inputs.dotnet-version}} + group: local-bundle-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: local-bundle: strategy: @@ -81,27 +71,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install Python - if: matrix.version != 'nightly-latest' - uses: actions/setup-python@v6 - with: - python-version: ${{ inputs.python-version || '3.13' }} - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - name: Fetch latest CodeQL bundle run: | wget https://github.com/github/codeql-action/releases/latest/download/codeql-bundle-linux64.tar.zst diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 9cae8d3622..33dbd2f69d 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -25,86 +25,76 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: multi-language-autodetect-${{github.ref}}-${{inputs.go-version}}-${{inputs.python-version}}-${{inputs.dotnet-version}} + group: multi-language-autodetect-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: multi-language-autodetect: strategy: fail-fast: false matrix: include: - - os: macos-latest - version: stable-v2.17.6 - os: ubuntu-latest version: stable-v2.17.6 - os: macos-latest - version: stable-v2.18.4 + version: stable-v2.17.6 - os: ubuntu-latest version: stable-v2.18.4 - os: macos-latest - version: stable-v2.19.4 + version: stable-v2.18.4 - os: ubuntu-latest version: stable-v2.19.4 - os: macos-latest - version: stable-v2.20.7 + version: stable-v2.19.4 - os: ubuntu-latest version: stable-v2.20.7 - os: macos-latest - version: stable-v2.21.4 + version: stable-v2.20.7 - os: ubuntu-latest version: stable-v2.21.4 - os: macos-latest - version: stable-v2.22.4 + version: stable-v2.21.4 - os: ubuntu-latest version: stable-v2.22.4 - os: macos-latest - version: default + version: stable-v2.22.4 - os: ubuntu-latest version: default - os: macos-latest - version: linked + version: default - os: ubuntu-latest version: linked - os: macos-latest - version: nightly-latest + version: linked - os: ubuntu-latest version: nightly-latest + - os: macos-latest + version: nightly-latest name: Multi-language repository if: github.triggering_actor != 'dependabot[bot]' permissions: @@ -115,6 +105,15 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -122,20 +121,14 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Install Python - if: matrix.version != 'nightly-latest' + - name: Install Python 3.13 for older CLI versions + # We need Python 3.13 for older CLI versions because they are not compatible with Python 3.14 or newer. + # See https://github.com/github/codeql-action/pull/3212 + if: matrix.version != 'nightly-latest' && matrix.version != 'linked' uses: actions/setup-python@v6 with: - python-version: ${{ inputs.python-version || '3.13' }} - - name: Install .NET - uses: actions/setup-dotnet@v5 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + python-version: '3.13' + - name: Use Xcode 16 if: runner.os == 'macOS' && matrix.version != 'nightly-latest' run: sudo xcode-select -s "/Applications/Xcode_16.app" diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml index d0304ecd1d..94280eeedb 100644 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ b/.github/workflows/__packaging-codescanning-config-inputs-js.yml @@ -25,44 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: packaging-codescanning-config-inputs-js-${{github.ref}}-${{inputs.go-version}}-${{inputs.python-version}}-${{inputs.dotnet-version}} + group: packaging-codescanning-config-inputs-js-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: packaging-codescanning-config-inputs-js: strategy: @@ -85,6 +75,15 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Install Node.js uses: actions/setup-node@v6 with: @@ -99,20 +98,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Install Python - if: matrix.version != 'nightly-latest' - uses: actions/setup-python@v6 - with: - python-version: ${{ inputs.python-version || '3.13' }} - - name: Install .NET - uses: actions/setup-dotnet@v5 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: config-file: '.github/codeql/codeql-config-packaging3.yml' diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml index f971030093..146bc43552 100644 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ b/.github/workflows/__packaging-config-inputs-js.yml @@ -25,34 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: packaging-config-inputs-js-${{github.ref}}-${{inputs.go-version}}-${{inputs.dotnet-version}} + group: packaging-config-inputs-js-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: packaging-config-inputs-js: strategy: @@ -75,6 +75,15 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Install Node.js uses: actions/setup-node@v6 with: @@ -89,15 +98,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Install .NET - uses: actions/setup-dotnet@v5 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: config-file: '.github/codeql/codeql-config-packaging3.yml' diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml index 99bd171f9d..fddd971f39 100644 --- a/.github/workflows/__packaging-config-js.yml +++ b/.github/workflows/__packaging-config-js.yml @@ -25,34 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: packaging-config-js-${{github.ref}}-${{inputs.go-version}}-${{inputs.dotnet-version}} + group: packaging-config-js-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: packaging-config-js: strategy: @@ -75,6 +75,15 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Install Node.js uses: actions/setup-node@v6 with: @@ -89,15 +98,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Install .NET - uses: actions/setup-dotnet@v5 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: config-file: '.github/codeql/codeql-config-packaging.yml' diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml index e5cd0182ec..64bd575d55 100644 --- a/.github/workflows/__packaging-inputs-js.yml +++ b/.github/workflows/__packaging-inputs-js.yml @@ -25,34 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: packaging-inputs-js-${{github.ref}}-${{inputs.go-version}}-${{inputs.dotnet-version}} + group: packaging-inputs-js-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: packaging-inputs-js: strategy: @@ -75,6 +75,15 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: ${{ inputs.go-version || '>=1.21.0' }} + cache: false - name: Install Node.js uses: actions/setup-node@v6 with: @@ -89,15 +98,6 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - name: Install Go - uses: actions/setup-go@v6 - with: - go-version: ${{ inputs.go-version || '>=1.21.0' }} - cache: false - - name: Install .NET - uses: actions/setup-dotnet@v5 - with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: config-file: '.github/codeql/codeql-config-packaging2.yml' diff --git a/.github/workflows/__remote-config.yml b/.github/workflows/__remote-config.yml index abf5cd21e2..4302583d73 100644 --- a/.github/workflows/__remote-config.yml +++ b/.github/workflows/__remote-config.yml @@ -25,44 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: remote-config-${{github.ref}}-${{inputs.go-version}}-${{inputs.python-version}}-${{inputs.dotnet-version}} + group: remote-config-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: remote-config: strategy: @@ -83,27 +73,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install Python - if: matrix.version != 'nightly-latest' - uses: actions/setup-python@v6 - with: - python-version: ${{ inputs.python-version || '3.13' }} - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - uses: ./../action/init with: tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/__resolve-environment-action.yml b/.github/workflows/__resolve-environment-action.yml index 8b3391064a..982e4e7152 100644 --- a/.github/workflows/__resolve-environment-action.yml +++ b/.github/workflows/__resolve-environment-action.yml @@ -39,10 +39,10 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-latest - version: default - os: ubuntu-latest version: linked + - os: ubuntu-latest + version: default - os: ubuntu-latest version: nightly-latest name: Resolve environment diff --git a/.github/workflows/__split-workflow.yml b/.github/workflows/__split-workflow.yml index 58e547f367..7dfa812499 100644 --- a/.github/workflows/__split-workflow.yml +++ b/.github/workflows/__split-workflow.yml @@ -25,34 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: split-workflow-${{github.ref}}-${{inputs.go-version}}-${{inputs.dotnet-version}} + group: split-workflow-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: split-workflow: strategy: @@ -81,22 +81,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - uses: ./../action/init with: config-file: '.github/codeql/codeql-config-packaging3.yml' diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 7749f1b814..efdbde7215 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -25,34 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: swift-custom-build-${{github.ref}}-${{inputs.go-version}}-${{inputs.dotnet-version}} + group: swift-custom-build-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: swift-custom-build: strategy: @@ -75,22 +75,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - name: Use Xcode 16 if: runner.os == 'macOS' && matrix.version != 'nightly-latest' run: sudo xcode-select -s "/Applications/Xcode_16.app" diff --git a/.github/workflows/__unset-environment.yml b/.github/workflows/__unset-environment.yml index 5be68f8102..535362e836 100644 --- a/.github/workflows/__unset-environment.yml +++ b/.github/workflows/__unset-environment.yml @@ -25,44 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: unset-environment-${{github.ref}}-${{inputs.go-version}}-${{inputs.python-version}}-${{inputs.dotnet-version}} + group: unset-environment-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: unset-environment: strategy: @@ -83,27 +73,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install Python - if: matrix.version != 'nightly-latest' - uses: actions/setup-python@v6 - with: - python-version: ${{ inputs.python-version || '3.13' }} - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - uses: ./../action/init id: init with: diff --git a/.github/workflows/__upload-ref-sha-input.yml b/.github/workflows/__upload-ref-sha-input.yml index f9a832d7ee..4e95021495 100644 --- a/.github/workflows/__upload-ref-sha-input.yml +++ b/.github/workflows/__upload-ref-sha-input.yml @@ -25,44 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: upload-ref-sha-input-${{github.ref}}-${{inputs.go-version}}-${{inputs.python-version}}-${{inputs.dotnet-version}} + group: upload-ref-sha-input-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: upload-ref-sha-input: strategy: @@ -81,27 +71,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install Python - if: matrix.version != 'nightly-latest' - uses: actions/setup-python@v6 - with: - python-version: ${{ inputs.python-version || '3.13' }} - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - uses: ./../action/init with: tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/__upload-sarif.yml b/.github/workflows/__upload-sarif.yml index 873ba5ca99..547828d072 100644 --- a/.github/workflows/__upload-sarif.yml +++ b/.github/workflows/__upload-sarif.yml @@ -25,44 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: upload-sarif-${{github.ref}}-${{inputs.go-version}}-${{inputs.python-version}}-${{inputs.dotnet-version}} + group: upload-sarif-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: upload-sarif: strategy: @@ -88,27 +78,22 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install Python - if: matrix.version != 'nightly-latest' - uses: actions/setup-python@v6 - with: - python-version: ${{ inputs.python-version || '3.13' }} - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - uses: ./../action/init with: tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/__with-checkout-path.yml b/.github/workflows/__with-checkout-path.yml index 11f6e1dbc0..0d97287577 100644 --- a/.github/workflows/__with-checkout-path.yml +++ b/.github/workflows/__with-checkout-path.yml @@ -25,44 +25,34 @@ on: - cron: '0 5 * * *' workflow_dispatch: inputs: - go-version: - type: string - description: The version of Go to install - required: false - default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' dotnet-version: type: string description: The version of .NET to install required: false default: 9.x - workflow_call: - inputs: go-version: type: string description: The version of Go to install required: false default: '>=1.21.0' - python-version: - type: string - description: The version of Python to install - required: false - default: '3.13' + workflow_call: + inputs: dotnet-version: type: string description: The version of .NET to install required: false default: 9.x + go-version: + type: string + description: The version of Go to install + required: false + default: '>=1.21.0' defaults: run: shell: bash concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' || false }} - group: with-checkout-path-${{github.ref}}-${{inputs.go-version}}-${{inputs.python-version}}-${{inputs.dotnet-version}} + group: with-checkout-path-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}} jobs: with-checkout-path: strategy: @@ -82,27 +72,22 @@ jobs: # This ensures we don't accidentally use the original checkout for any part of the test. - name: Check out repository uses: actions/checkout@v6 - - name: Prepare test - id: prepare-test - uses: ./.github/actions/prepare-test + - name: Install .NET + uses: actions/setup-dotnet@v5 with: - version: ${{ matrix.version }} - use-all-platform-bundle: 'false' - setup-kotlin: 'true' + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Install Go uses: actions/setup-go@v6 with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - - name: Install Python - if: matrix.version != 'nightly-latest' - uses: actions/setup-python@v6 - with: - python-version: ${{ inputs.python-version || '3.13' }} - - name: Install .NET - uses: actions/setup-dotnet@v5 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test with: - dotnet-version: ${{ inputs.dotnet-version || '9.x' }} + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + setup-kotlin: 'true' - name: Delete original checkout run: | # delete the original checkout so we don't accidentally use it. diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 77a544cfa8..f240997030 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -52,19 +52,10 @@ jobs: - name: Verify compiled JS up to date run: .github/workflows/script/check-js.sh - - name: Verify PR checks up to date - if: always() - run: .github/workflows/script/verify-pr-checks.sh - - name: Run unit tests if: always() run: npm test - - name: Run pr-checks tests - if: always() - working-directory: pr-checks - run: npm ci && npx tsx --test - - name: Lint if: always() && matrix.os != 'windows-latest' run: npm run lint-ci @@ -76,6 +67,43 @@ jobs: sarif_file: eslint.sarif category: eslint + # Verifying the PR checks are up-to-date requires Node 24. The PR checks are not dependent + # on the main codebase and therefore do not need to be run as part of the same matrix that + # we use for the `unit-tests` job. + verify-pr-checks: + name: Verify PR checks + if: github.triggering_actor != 'dependabot[bot]' + permissions: + contents: read + runs-on: ubuntu-slim + timeout-minutes: 10 + + steps: + - name: Prepare git (Windows) + if: runner.os == 'Windows' + run: git config --global core.autocrlf false + + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Verify PR checks up to date + if: always() + run: .github/workflows/script/verify-pr-checks.sh + + - name: Run pr-checks tests + if: always() + working-directory: pr-checks + run: npx tsx --test + check-node-version: if: github.triggering_actor != 'dependabot[bot]' name: Check Action Node versions diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml index 095c0726f2..cafc432d98 100644 --- a/.github/workflows/rebuild.yml +++ b/.github/workflows/rebuild.yml @@ -29,6 +29,12 @@ jobs: fetch-depth: 0 ref: ${{ env.HEAD_REF }} + - name: Set up Node.js + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: 'npm' + - name: Remove label if: github.event_name == 'pull_request' env: @@ -49,9 +55,18 @@ jobs: git fetch origin "$BASE_BRANCH" # Allow merge conflicts in `lib`, since rebuilding should resolve them. - git merge "origin/$BASE_BRANCH" || echo "Merge conflicts detected, continuing." + git merge "origin/$BASE_BRANCH" MERGE_RESULT=$? + if [ "$MERGE_RESULT" -eq 0 ]; then + echo "Merge succeeded cleanly." + elif [ "$MERGE_RESULT" -eq 1 ]; then + echo "Merge conflicts detected (exit code $MERGE_RESULT), continuing." + else + echo "git merge failed with unexpected exit code $MERGE_RESULT." + exit 1 + fi + if [ "$MERGE_RESULT" -ne 0 ]; then echo "merge-in-progress=true" >> $GITHUB_OUTPUT @@ -79,7 +94,7 @@ jobs: working-directory: pr-checks run: | npm ci - npx tsx sync_back.ts --verbose + npx tsx sync-back.ts --verbose - name: Generate workflows working-directory: pr-checks @@ -104,7 +119,7 @@ jobs: # Otherwise, just commit the changes. if git rev-parse --verify MERGE_HEAD >/dev/null 2>&1; then echo "In progress merge detected, finishing it up." - git merge --continue --no-edit + git commit --no-edit else echo "No in-progress merge detected, committing changes." git commit -m "Rebuild" diff --git a/CHANGELOG.md b/CHANGELOG.md index bd32a52fcc..c8ca27f718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. +## 3.33.0 - 16 Mar 2026 + +- Upcoming change: Starting April 2026, the CodeQL Action will skip collecting file coverage information on pull requests to improve analysis performance. File coverage information will still be computed on non-PR analyses. Pull request analyses will log a warning about this upcoming change. [#3562](https://github.com/github/codeql-action/pull/3562) + To opt out of this change: + - **Repositories owned by an organization:** Create a custom repository property with the name `github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to `true` in the repository's settings. For more information, see [Managing custom properties for repositories in your organization](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). Alternatively, if you are using an advanced setup workflow, you can set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true` in your workflow. + - **User-owned repositories using default setup:** Switch to an advanced setup workflow and set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true` in your workflow. + - **User-owned repositories using advanced setup:** Set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true` in your workflow. +- Fixed [a bug](https://github.com/github/codeql-action/issues/3555) which caused the CodeQL Action to fail loading repository properties if a "Multi select" repository property was configured for the repository. [#3557](https://github.com/github/codeql-action/pull/3557) +- The CodeQL Action now loads [custom repository properties](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization) on GitHub Enterprise Server, enabling the customization of features such as `github-codeql-disable-overlay` that was previously only available on GitHub.com. [#3559](https://github.com/github/codeql-action/pull/3559) +- Once [private package registries](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries) can be configured with OIDC-based authentication for organizations, the CodeQL Action will now be able to accept such configurations. [#3563](https://github.com/github/codeql-action/pull/3563) +- Fixed the retry mechanism for database uploads. Previously this would fail with the error "Response body object should not be disturbed or locked". [#3564](https://github.com/github/codeql-action/pull/3564) +- A warning is now emitted if the CodeQL Action detects a repository property whose name suggests that it relates to the CodeQL Action, but which is not one of the properties recognised by the current version of the CodeQL Action. [#3570](https://github.com/github/codeql-action/pull/3570) + ## 3.32.6 - 05 Mar 2026 - Update default CodeQL bundle version to [2.24.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.3). [#3548](https://github.com/github/codeql-action/pull/3548) diff --git a/ava.config.mjs b/ava.config.mjs new file mode 100644 index 0000000000..7bd103c94e --- /dev/null +++ b/ava.config.mjs @@ -0,0 +1,9 @@ +export default { + typescript: { + rewritePaths: { + "src/": "build/", + }, + compile: false, + }, + require: ["./ava.setup.mjs"], +}; diff --git a/ava.setup.mjs b/ava.setup.mjs new file mode 100644 index 0000000000..e6c370e01b --- /dev/null +++ b/ava.setup.mjs @@ -0,0 +1,3 @@ +import pkg from "./package.json" with { type: "json" }; + +globalThis.__CODEQL_ACTION_VERSION__ = pkg.version; diff --git a/build.mjs b/build.mjs index 05f7e05021..54b9cafd48 100644 --- a/build.mjs +++ b/build.mjs @@ -5,6 +5,8 @@ import { fileURLToPath } from "node:url"; import * as esbuild from "esbuild"; import { globSync } from "glob"; +import pkg from "./package.json" with { type: "json" }; + const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); @@ -13,7 +15,7 @@ const OUT_DIR = join(__dirname, "lib"); /** * Clean the output directory before building. - * + * * @type {esbuild.Plugin} */ const cleanPlugin = { @@ -27,7 +29,7 @@ const cleanPlugin = { /** * Copy defaults.json to the output directory since other projects depend on it. - * + * * @type {esbuild.Plugin} */ const copyDefaultsPlugin = { @@ -69,6 +71,9 @@ const context = await esbuild.context({ platform: "node", plugins: [cleanPlugin, copyDefaultsPlugin, onEndPlugin], target: ["node20"], + define: { + __CODEQL_ACTION_VERSION__: JSON.stringify(pkg.version), + }, }); await context.rebuild(); diff --git a/eslint.config.mjs b/eslint.config.mjs index 6ac800276e..bc77329978 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -19,9 +19,10 @@ export default [ "src/testdata/**/*", "tests/**/*", "build.mjs", + "ava.config.mjs", + "ava.setup.mjs", "eslint.config.mjs", ".github/**/*", - "pr-checks/**/*", ], }, // eslint recommended config @@ -161,10 +162,36 @@ export default [ "@typescript-eslint/no-unused-vars": [ "error", { + "args": "all", "argsIgnorePattern": "^_", } ], "func-style": "off", }, }, + { + files: ["pr-checks/**/*.ts"], + + languageOptions: { + parserOptions: { + // Use the correct `tsconfig.json` for `pr-checks`. + project: "./pr-checks/tsconfig.json", + }, + }, + + rules: { + // The scripts in `pr-checks` are expected to output to the console. + "no-console": "off", + + "@typescript-eslint/no-floating-promises": [ + "error", + { + allowForKnownSafeCalls: [ + // Avoid needing explicit `void` in front of `describe` calls in test files. + { from: "package", name: ["describe"], package: "node:test" }, + ], + }, + ], + }, + }, ]; diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index 9dfde32cae..ec89e511e9 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -53394,8 +53287,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -57881,7 +57774,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -57928,7 +57821,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID() { @@ -92763,7 +92656,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -92835,7 +92728,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -99940,7 +99833,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -100195,7 +100088,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -100211,7 +100104,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -100238,7 +100131,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -100310,11 +100203,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -102526,7 +102419,7 @@ The following characters are not allowed in files that are uploaded due to limit }); // node_modules/@actions/artifact/package.json -var require_package3 = __commonJS({ +var require_package2 = __commonJS({ "node_modules/@actions/artifact/package.json"(exports2, module2) { module2.exports = { name: "@actions/artifact", @@ -102605,7 +102498,7 @@ var require_user_agent2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = void 0; - var packageJson = require_package3(); + var packageJson = require_package2(); function getUserAgentString() { return `@actions/artifact-${packageJson.version}`; } @@ -107072,10 +106965,10 @@ var require_util20 = __commonJS({ return typeof arg === "number"; } exports2.isNumber = isNumber; - function isString(arg) { + function isString2(arg) { return typeof arg === "string"; } - exports2.isString = isString; + exports2.isString = isString2; function isSymbol(arg) { return typeof arg === "symbol"; } @@ -107088,10 +106981,10 @@ var require_util20 = __commonJS({ return objectToString(re) === "[object RegExp]"; } exports2.isRegExp = isRegExp; - function isObject2(arg) { + function isObject3(arg) { return typeof arg === "object" && arg !== null; } - exports2.isObject = isObject2; + exports2.isObject = isObject3; function isDate(d) { return objectToString(d) === "[object Date]"; } @@ -109133,11 +109026,11 @@ var require_baseGetTag = __commonJS({ // node_modules/lodash/isObject.js var require_isObject = __commonJS({ "node_modules/lodash/isObject.js"(exports2, module2) { - function isObject2(value) { + function isObject3(value) { var type2 = typeof value; return value != null && (type2 == "object" || type2 == "function"); } - module2.exports = isObject2; + module2.exports = isObject3; } }); @@ -109145,13 +109038,13 @@ var require_isObject = __commonJS({ var require_isFunction = __commonJS({ "node_modules/lodash/isFunction.js"(exports2, module2) { var baseGetTag = require_baseGetTag(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var asyncTag = "[object AsyncFunction]"; var funcTag = "[object Function]"; var genTag = "[object GeneratorFunction]"; var proxyTag = "[object Proxy]"; function isFunction(value) { - if (!isObject2(value)) { + if (!isObject3(value)) { return false; } var tag = baseGetTag(value); @@ -109212,7 +109105,7 @@ var require_baseIsNative = __commonJS({ "node_modules/lodash/_baseIsNative.js"(exports2, module2) { var isFunction = require_isFunction(); var isMasked = require_isMasked(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var toSource = require_toSource(); var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; @@ -109224,7 +109117,7 @@ var require_baseIsNative = __commonJS({ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function baseIsNative(value) { - if (!isObject2(value) || isMasked(value)) { + if (!isObject3(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; @@ -109392,9 +109285,9 @@ var require_isIterateeCall = __commonJS({ var eq = require_eq2(); var isArrayLike = require_isArrayLike(); var isIndex = require_isIndex(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); function isIterateeCall(value, index, object) { - if (!isObject2(object)) { + if (!isObject3(object)) { return false; } var type2 = typeof index; @@ -109639,13 +109532,13 @@ var require_nativeKeysIn = __commonJS({ // node_modules/lodash/_baseKeysIn.js var require_baseKeysIn = __commonJS({ "node_modules/lodash/_baseKeysIn.js"(exports2, module2) { - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var isPrototype = require_isPrototype(); var nativeKeysIn = require_nativeKeysIn(); var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function baseKeysIn(object) { - if (!isObject2(object)) { + if (!isObject3(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; @@ -110137,7 +110030,7 @@ var require_event_target_shim = __commonJS({ var CAPTURE = 1; var BUBBLE = 2; var ATTRIBUTE = 3; - function isObject2(x) { + function isObject3(x) { return x !== null && typeof x === "object"; } function getListeners(eventTarget) { @@ -110163,7 +110056,7 @@ var require_event_target_shim = __commonJS({ return null; }, set(listener) { - if (typeof listener !== "function" && !isObject2(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { listener = null; } const listeners = getListeners(this); @@ -110254,11 +110147,11 @@ var require_event_target_shim = __commonJS({ if (listener == null) { return; } - if (typeof listener !== "function" && !isObject2(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { throw new TypeError("'listener' should be a function or an object."); } const listeners = getListeners(this); - const optionsIsObj = isObject2(options); + const optionsIsObj = isObject3(options); const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; const newNode = { @@ -110295,7 +110188,7 @@ var require_event_target_shim = __commonJS({ return; } const listeners = getListeners(this); - const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options); + const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; let prev = null; let node = listeners.get(eventName); @@ -161103,6 +160996,11 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.21"; var minimumVersion = "3.14"; +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + // src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; var GITHUB_DOTCOM_URL = "https://github.com"; @@ -161229,7 +161127,6 @@ async function asyncSome(array, predicate) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -161246,7 +161143,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -161404,6 +161301,7 @@ retry.VERSION = VERSION7; // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -161418,10 +161316,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -161733,6 +161628,7 @@ var semver2 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -161944,6 +161840,12 @@ async function isAnalyzingDefaultBranch() { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -162086,70 +161988,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -162161,25 +162041,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -162189,23 +162064,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -162221,11 +162086,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -162243,11 +162105,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -162268,28 +162125,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; function getPathToParsedConfigFile(tempDir) { return path3.join(tempDir, "config"); @@ -163252,7 +163101,7 @@ function getArtifactSuffix(matrix) { if (matrix) { try { const matrixObject = JSON.parse(matrix); - if (matrixObject !== null && typeof matrixObject === "object") { + if (isObject2(matrixObject)) { for (const matrixKey of Object.keys(matrixObject).sort()) suffix += `-${matrixObject[matrixKey]}`; } else { diff --git a/lib/analyze-action.js b/lib/analyze-action.js index d5d2afe762..07250a0750 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -3842,18 +3842,18 @@ var require_webidl = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context2) { - const plural = context2.types.length === 1 ? "" : " one of"; - const message = `${context2.argument} could not be converted to${plural}: ${context2.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; return webidl.errors.exception({ - header: context2.prefix, + header: context3.prefix, message }); }; - webidl.errors.invalidArgument = function(context2) { + webidl.errors.invalidArgument = function(context3) { return webidl.errors.exception({ - header: context2.prefix, - message: `"${context2.value}" is an invalid ${context2.type}.` + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -9849,17 +9849,17 @@ var require_api_request = __commonJS({ } } } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -9896,7 +9896,7 @@ var require_api_request = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context2 + context: context3 }); } } @@ -10065,17 +10065,17 @@ var require_api_stream = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context2, callback, responseHeaders } = this; + const { factory, opaque, context: context3, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -10103,7 +10103,7 @@ var require_api_stream = __commonJS({ statusCode, headers, opaque, - context: context2 + context: context3 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -10295,7 +10295,7 @@ var require_api_pipeline = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -10304,10 +10304,10 @@ var require_api_pipeline = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context2 } = this; + const { opaque, handler: handler2, context: context3 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10325,7 +10325,7 @@ var require_api_pipeline = __commonJS({ headers, opaque, body: this.res, - context: context2 + context: context3 }); } catch (err) { this.res.on("error", util.nop); @@ -10409,7 +10409,7 @@ var require_api_upgrade = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; @@ -10423,7 +10423,7 @@ var require_api_upgrade = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10431,7 +10431,7 @@ var require_api_upgrade = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -10500,20 +10500,20 @@ var require_api_connect = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -10525,7 +10525,7 @@ var require_api_connect = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -21321,7 +21321,7 @@ var require_core = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; - exports2.exportVariable = exportVariable8; + exports2.exportVariable = exportVariable9; exports2.setSecret = setSecret; exports2.addPath = addPath; exports2.getInput = getInput2; @@ -21353,7 +21353,7 @@ var require_core = __commonJS({ ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable8(name, val) { + function exportVariable9(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; @@ -24840,18 +24840,18 @@ var require_webidl2 = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context2) { - const plural = context2.types.length === 1 ? "" : " one of"; - const message = `${context2.argument} could not be converted to${plural}: ${context2.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; return webidl.errors.exception({ - header: context2.prefix, + header: context3.prefix, message }); }; - webidl.errors.invalidArgument = function(context2) { + webidl.errors.invalidArgument = function(context3) { return webidl.errors.exception({ - header: context2.prefix, - message: `"${context2.value}" is an invalid ${context2.type}.` + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -30847,17 +30847,17 @@ var require_api_request2 = __commonJS({ } } } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -30894,7 +30894,7 @@ var require_api_request2 = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context2 + context: context3 }); } } @@ -31063,17 +31063,17 @@ var require_api_stream2 = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context2, callback, responseHeaders } = this; + const { factory, opaque, context: context3, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -31101,7 +31101,7 @@ var require_api_stream2 = __commonJS({ statusCode, headers, opaque, - context: context2 + context: context3 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -31293,7 +31293,7 @@ var require_api_pipeline2 = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -31302,10 +31302,10 @@ var require_api_pipeline2 = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context2 } = this; + const { opaque, handler: handler2, context: context3 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31323,7 +31323,7 @@ var require_api_pipeline2 = __commonJS({ headers, opaque, body: this.res, - context: context2 + context: context3 }); } catch (err) { this.res.on("error", util.nop); @@ -31407,7 +31407,7 @@ var require_api_upgrade2 = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; @@ -31421,7 +31421,7 @@ var require_api_upgrade2 = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31429,7 +31429,7 @@ var require_api_upgrade2 = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -31498,20 +31498,20 @@ var require_api_connect2 = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -31523,7 +31523,7 @@ var require_api_connect2 = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -40178,8 +40178,8 @@ function isDefined(value) { function isKeyOperator(operator) { return operator === ";" || operator === "&" || operator === "?"; } -function getValues(context2, operator, key, modifier) { - var value = context2[key], result = []; +function getValues(context3, operator, key, modifier) { + var value = context3[key], result = []; if (isDefined(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); @@ -40243,7 +40243,7 @@ function parseUrl(template) { expand: expand.bind(null, template) }; } -function expand(template, context2) { +function expand(template, context3) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, @@ -40257,7 +40257,7 @@ function expand(template, context2) { } expression.split(/,/g).forEach(function(variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context2, operator, tmp[1], tmp[2] || tmp[3])); + values.push(getValues(context3, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -48747,7 +48640,7 @@ var require_internal_glob_options_helper = __commonJS({ })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOptions = getOptions; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); function getOptions(copy) { const result = { followSymbolicLinks: true, @@ -48759,23 +48652,23 @@ var require_internal_glob_options_helper = __commonJS({ if (copy) { if (typeof copy.followSymbolicLinks === "boolean") { result.followSymbolicLinks = copy.followSymbolicLinks; - core15.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + core16.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } if (typeof copy.implicitDescendants === "boolean") { result.implicitDescendants = copy.implicitDescendants; - core15.debug(`implicitDescendants '${result.implicitDescendants}'`); + core16.debug(`implicitDescendants '${result.implicitDescendants}'`); } if (typeof copy.matchDirectories === "boolean") { result.matchDirectories = copy.matchDirectories; - core15.debug(`matchDirectories '${result.matchDirectories}'`); + core16.debug(`matchDirectories '${result.matchDirectories}'`); } if (typeof copy.omitBrokenSymbolicLinks === "boolean") { result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core15.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + core16.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } if (typeof copy.excludeHiddenFiles === "boolean") { result.excludeHiddenFiles = copy.excludeHiddenFiles; - core15.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + core16.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } return result; @@ -50403,7 +50296,7 @@ var require_internal_globber = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var fs18 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); var path16 = __importStar2(require("path")); @@ -50456,7 +50349,7 @@ var require_internal_globber = __commonJS({ } const stack = []; for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core15.debug(`Search path '${searchPath}'`); + core16.debug(`Search path '${searchPath}'`); try { yield __await2(fs18.promises.lstat(searchPath)); } catch (err) { @@ -50531,7 +50424,7 @@ var require_internal_globber = __commonJS({ } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { - core15.debug(`Broken symlink '${item.path}'`); + core16.debug(`Broken symlink '${item.path}'`); return void 0; } throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); @@ -50547,7 +50440,7 @@ var require_internal_globber = __commonJS({ traversalChain.pop(); } if (traversalChain.some((x) => x === realPath)) { - core15.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + core16.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); return void 0; } traversalChain.push(realPath); @@ -50650,7 +50543,7 @@ var require_internal_hash_files = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hashFiles = hashFiles2; var crypto3 = __importStar2(require("crypto")); - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var fs18 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); @@ -50659,7 +50552,7 @@ var require_internal_hash_files = __commonJS({ return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; - const writeDelegate = verbose ? core15.info : core15.debug; + const writeDelegate = verbose ? core16.info : core16.debug; let hasMatch = false; const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); const result = crypto3.createHash("sha256"); @@ -52050,7 +51943,7 @@ var require_cacheUtils = __commonJS({ exports2.assertDefined = assertDefined; exports2.getCacheVersion = getCacheVersion; exports2.getRuntimeToken = getRuntimeToken; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var exec = __importStar2(require_exec()); var glob2 = __importStar2(require_glob()); var io7 = __importStar2(require_io()); @@ -52101,7 +51994,7 @@ var require_cacheUtils = __commonJS({ _e = false; const file = _c; const relativeFile = path16.relative(workspace, file).replace(new RegExp(`\\${path16.sep}`, "g"), "/"); - core15.debug(`Matched: ${relativeFile}`); + core16.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); } else { @@ -52129,7 +52022,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { let versionOutput = ""; additionalArgs.push("--version"); - core15.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + core16.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, @@ -52140,10 +52033,10 @@ var require_cacheUtils = __commonJS({ } }); } catch (err) { - core15.debug(err.message); + core16.debug(err.message); } versionOutput = versionOutput.trim(); - core15.debug(versionOutput); + core16.debug(versionOutput); return versionOutput; }); } @@ -52151,7 +52044,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); const version = semver9.clean(versionOutput); - core15.debug(`zstd version: ${version}`); + core16.debug(`zstd version: ${version}`); if (versionOutput === "") { return constants_1.CompressionMethod.Gzip; } else { @@ -52276,14 +52169,14 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { + var context3 = {}; + for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; + context3.addInitializer = function(f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context3); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); @@ -53010,19 +52903,19 @@ var require_logger = __commonJS({ logger: clientLogger }; } - var context2 = createLoggerContext({ + var context3 = createLoggerContext({ logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", namespace: "typeSpecRuntime" }); - exports2.TypeSpecRuntimeLogger = context2.logger; + exports2.TypeSpecRuntimeLogger = context3.logger; function setLogLevel(logLevel) { - context2.setLogLevel(logLevel); + context3.setLogLevel(logLevel); } function getLogLevel() { - return context2.getLogLevel(); + return context3.getLogLevel(); } function createClientLogger(namespace) { - return context2.createClientLogger(namespace); + return context3.createClientLogger(namespace); } } }); @@ -53394,8 +53287,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -57268,19 +57161,19 @@ var require_commonjs2 = __commonJS({ exports2.getLogLevel = getLogLevel; exports2.createClientLogger = createClientLogger; var logger_1 = require_internal(); - var context2 = (0, logger_1.createLoggerContext)({ + var context3 = (0, logger_1.createLoggerContext)({ logLevelEnvVarName: "AZURE_LOG_LEVEL", namespace: "azure" }); - exports2.AzureLogger = context2.logger; + exports2.AzureLogger = context3.logger; function setLogLevel(level) { - context2.setLogLevel(level); + context3.setLogLevel(level); } function getLogLevel() { - return context2.getLogLevel(); + return context3.getLogLevel(); } function createClientLogger(namespace) { - return context2.createClientLogger(namespace); + return context3.createClientLogger(namespace); } } }); @@ -57881,7 +57774,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID2; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -57928,7 +57821,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID2() { @@ -58190,14 +58083,14 @@ var require_tracingContext = __commonJS({ namespace: /* @__PURE__ */ Symbol.for("@azure/core-tracing namespace") }; function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); + let context3 = new TracingContextImpl(options.parentContext); if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + context3 = context3.setValue(exports2.knownContextKeys.span, options.span); } if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + context3 = context3.setValue(exports2.knownContextKeys.namespace, options.namespace); } - return context2; + return context3; } var TracingContextImpl = class _TracingContextImpl { _contextMap; @@ -58335,8 +58228,8 @@ var require_tracingClient = __commonJS({ span.end(); } } - function withContext(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); + function withContext(context3, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context3, callback, ...callbackArgs); } function parseTraceparentHeader(traceparentHeader) { return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); @@ -91807,7 +91700,7 @@ var require_uploadUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadProgress = void 0; exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors3(); var UploadProgress = class { @@ -91849,7 +91742,7 @@ var require_uploadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const uploadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core15.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); + core16.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -91906,14 +91799,14 @@ var require_uploadUtils = __commonJS({ }; try { uploadProgress.startDisplayTimer(); - core15.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + core16.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); if (response._response.status >= 400) { throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; } catch (error3) { - core15.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + core16.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); throw error3; } finally { uploadProgress.stopDisplayTimer(); @@ -91998,7 +91891,7 @@ var require_requestUtils = __commonJS({ exports2.retry = retry2; exports2.retryTypedResponse = retryTypedResponse; exports2.retryHttpClientResponse = retryHttpClientResponse; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var http_client_1 = require_lib(); var constants_1 = require_constants12(); function isSuccessStatusCode(statusCode) { @@ -92056,9 +91949,9 @@ var require_requestUtils = __commonJS({ isRetryable = isRetryableStatusCode(statusCode); errorMessage = `Cache service responded with ${statusCode}`; } - core15.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + core16.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); if (!isRetryable) { - core15.debug(`${name} - Error is not retryable`); + core16.debug(`${name} - Error is not retryable`); break; } yield sleep(delay2); @@ -92317,7 +92210,7 @@ var require_downloadUtils = __commonJS({ exports2.downloadCacheHttpClient = downloadCacheHttpClient; exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); @@ -92355,7 +92248,7 @@ var require_downloadUtils = __commonJS({ this.segmentIndex = this.segmentIndex + 1; this.segmentSize = segmentSize; this.receivedBytes = 0; - core15.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); + core16.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** * Sets the number of bytes received for the current segment. @@ -92389,7 +92282,7 @@ var require_downloadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core15.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + core16.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -92439,7 +92332,7 @@ var require_downloadUtils = __commonJS({ })); downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); - core15.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); + core16.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, writeStream); const contentLengthHeader = downloadResponse.message.headers["content-length"]; @@ -92450,7 +92343,7 @@ var require_downloadUtils = __commonJS({ throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { - core15.debug("Unable to validate download, no Content-Length header"); + core16.debug("Unable to validate download, no Content-Length header"); } }); } @@ -92568,7 +92461,7 @@ var require_downloadUtils = __commonJS({ const properties = yield client.getProperties(); const contentLength = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; if (contentLength < 0) { - core15.debug("Unable to determine content length, downloading file with http-client..."); + core16.debug("Unable to determine content length, downloading file with http-client..."); yield downloadCacheHttpClient(archiveLocation, archivePath); } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); @@ -92658,7 +92551,7 @@ var require_options = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadOptions = getUploadOptions; exports2.getDownloadOptions = getDownloadOptions; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -92678,9 +92571,9 @@ var require_options = __commonJS({ } result.uploadConcurrency = !isNaN(Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) ? Math.min(32, Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) : result.uploadConcurrency; result.uploadChunkSize = !isNaN(Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"])) ? Math.min(128 * 1024 * 1024, Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"]) * 1024 * 1024) : result.uploadChunkSize; - core15.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core15.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core15.debug(`Upload chunk size: ${result.uploadChunkSize}`); + core16.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core16.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core16.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } function getDownloadOptions(copy) { @@ -92716,12 +92609,12 @@ var require_options = __commonJS({ if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; } - core15.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core15.debug(`Download concurrency: ${result.downloadConcurrency}`); - core15.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core15.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core15.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core15.debug(`Lookup only: ${result.lookupOnly}`); + core16.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core16.debug(`Download concurrency: ${result.downloadConcurrency}`); + core16.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core16.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core16.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core16.debug(`Lookup only: ${result.lookupOnly}`); return result; } } @@ -92763,7 +92656,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -92835,7 +92728,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -92915,7 +92808,7 @@ var require_cacheHttpClient = __commonJS({ exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; exports2.saveCache = saveCache5; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); var fs18 = __importStar2(require("fs")); @@ -92933,7 +92826,7 @@ var require_cacheHttpClient = __commonJS({ throw new Error("Cache Service Url not found, unable to restore cache."); } const url2 = `${baseUrl}_apis/artifactcache/${resource}`; - core15.debug(`Resource Url: ${url2}`); + core16.debug(`Resource Url: ${url2}`); return url2; } function createAcceptHeader(type2, apiVersion) { @@ -92961,7 +92854,7 @@ var require_cacheHttpClient = __commonJS({ return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { - if (core15.isDebug()) { + if (core16.isDebug()) { yield printCachesListForDiagnostics(keys[0], httpClient, version); } return null; @@ -92974,9 +92867,9 @@ var require_cacheHttpClient = __commonJS({ if (!cacheDownloadUrl) { throw new Error("Cache not found."); } - core15.setSecret(cacheDownloadUrl); - core15.debug(`Cache Result:`); - core15.debug(JSON.stringify(cacheResult)); + core16.setSecret(cacheDownloadUrl); + core16.debug(`Cache Result:`); + core16.debug(JSON.stringify(cacheResult)); return cacheResult; }); } @@ -92990,10 +92883,10 @@ var require_cacheHttpClient = __commonJS({ const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - core15.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + core16.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`); for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { - core15.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); + core16.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); } } } @@ -93036,7 +92929,7 @@ Other caches with similar key:`); } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { return __awaiter2(this, void 0, void 0, function* () { - core15.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); + core16.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); const additionalHeaders = { "Content-Type": "application/octet-stream", "Content-Range": getContentRange(start, end) @@ -93058,7 +92951,7 @@ Other caches with similar key:`); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); const parallelUploads = [...new Array(concurrency).keys()]; - core15.debug("Awaiting all uploads"); + core16.debug("Awaiting all uploads"); let offset = 0; try { yield Promise.all(parallelUploads.map(() => __awaiter2(this, void 0, void 0, function* () { @@ -93101,16 +92994,16 @@ Other caches with similar key:`); yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); } else { const httpClient = createHttpClient(); - core15.debug("Upload cache"); + core16.debug("Upload cache"); yield uploadFile(httpClient, cacheId, archivePath, options); - core15.debug("Commiting cache"); + core16.debug("Commiting cache"); const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core15.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); + core16.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); } - core15.info("Cache saved successfully"); + core16.info("Cache saved successfully"); } }); } @@ -98593,7 +98486,7 @@ var require_cache5 = __commonJS({ exports2.isFeatureAvailable = isFeatureAvailable; exports2.restoreCache = restoreCache5; exports2.saveCache = saveCache5; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var path16 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); @@ -98652,7 +98545,7 @@ var require_cache5 = __commonJS({ function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core15.debug(`Cache service version: ${cacheServiceVersion}`); + core16.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); switch (cacheServiceVersion) { case "v2": @@ -98667,8 +98560,8 @@ var require_cache5 = __commonJS({ return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core15.debug("Resolved Keys:"); - core15.debug(JSON.stringify(keys)); + core16.debug("Resolved Keys:"); + core16.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -98686,19 +98579,19 @@ var require_cache5 = __commonJS({ return void 0; } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core15.info("Lookup only - skipping download"); + core16.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } archivePath = path16.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core15.debug(`Archive Path: ${archivePath}`); + core16.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core15.isDebug()) { + if (core16.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core15.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + core16.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core15.info("Cache restored successfully"); + core16.info("Cache restored successfully"); return cacheEntry.cacheKey; } catch (error3) { const typedError = error3; @@ -98706,16 +98599,16 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core15.error(`Failed to restore: ${error3.message}`); + core16.error(`Failed to restore: ${error3.message}`); } else { - core15.warning(`Failed to restore: ${error3.message}`); + core16.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core15.debug(`Failed to delete archive: ${error3}`); + core16.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -98726,8 +98619,8 @@ var require_cache5 = __commonJS({ options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core15.debug("Resolved Keys:"); - core15.debug(JSON.stringify(keys)); + core16.debug("Resolved Keys:"); + core16.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -98745,30 +98638,30 @@ var require_cache5 = __commonJS({ }; const response = yield twirpClient.GetCacheEntryDownloadURL(request2); if (!response.ok) { - core15.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); + core16.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); return void 0; } const isRestoreKeyMatch = request2.key !== response.matchedKey; if (isRestoreKeyMatch) { - core15.info(`Cache hit for restore-key: ${response.matchedKey}`); + core16.info(`Cache hit for restore-key: ${response.matchedKey}`); } else { - core15.info(`Cache hit for: ${response.matchedKey}`); + core16.info(`Cache hit for: ${response.matchedKey}`); } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core15.info("Lookup only - skipping download"); + core16.info("Lookup only - skipping download"); return response.matchedKey; } archivePath = path16.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core15.debug(`Archive path: ${archivePath}`); - core15.debug(`Starting download of archive to: ${archivePath}`); + core16.debug(`Archive path: ${archivePath}`); + core16.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core15.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core15.isDebug()) { + core16.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core16.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core15.info("Cache restored successfully"); + core16.info("Cache restored successfully"); return response.matchedKey; } catch (error3) { const typedError = error3; @@ -98776,9 +98669,9 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core15.error(`Failed to restore: ${error3.message}`); + core16.error(`Failed to restore: ${error3.message}`); } else { - core15.warning(`Failed to restore: ${error3.message}`); + core16.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -98787,7 +98680,7 @@ var require_cache5 = __commonJS({ yield utils.unlinkFile(archivePath); } } catch (error3) { - core15.debug(`Failed to delete archive: ${error3}`); + core16.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -98796,7 +98689,7 @@ var require_cache5 = __commonJS({ function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core15.debug(`Cache service version: ${cacheServiceVersion}`); + core16.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); checkKey(key); switch (cacheServiceVersion) { @@ -98814,26 +98707,26 @@ var require_cache5 = __commonJS({ const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core15.debug("Cache Paths:"); - core15.debug(`${JSON.stringify(cachePaths)}`); + core16.debug("Cache Paths:"); + core16.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core15.debug(`Archive Path: ${archivePath}`); + core16.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core15.isDebug()) { + if (core16.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const fileSizeLimit = 10 * 1024 * 1024 * 1024; const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core15.debug(`File Size: ${archiveFileSize}`); + core16.debug(`File Size: ${archiveFileSize}`); if (archiveFileSize > fileSizeLimit && !(0, config_1.isGhes)()) { throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); } - core15.debug("Reserving Cache"); + core16.debug("Reserving Cache"); const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { compressionMethod, enableCrossOsArchive, @@ -98846,26 +98739,26 @@ var require_cache5 = __commonJS({ } else { throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); } - core15.debug(`Saving Cache (ID: ${cacheId})`); + core16.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); } catch (error3) { const typedError = error3; if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError2.name) { - core15.info(`Failed to save: ${typedError.message}`); + core16.info(`Failed to save: ${typedError.message}`); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core15.error(`Failed to save: ${typedError.message}`); + core16.error(`Failed to save: ${typedError.message}`); } else { - core15.warning(`Failed to save: ${typedError.message}`); + core16.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core15.debug(`Failed to delete archive: ${error3}`); + core16.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -98878,23 +98771,23 @@ var require_cache5 = __commonJS({ const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core15.debug("Cache Paths:"); - core15.debug(`${JSON.stringify(cachePaths)}`); + core16.debug("Cache Paths:"); + core16.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core15.debug(`Archive Path: ${archivePath}`); + core16.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core15.isDebug()) { + if (core16.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core15.debug(`File Size: ${archiveFileSize}`); + core16.debug(`File Size: ${archiveFileSize}`); options.archiveSizeBytes = archiveFileSize; - core15.debug("Reserving Cache"); + core16.debug("Reserving Cache"); const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); const request2 = { key, @@ -98905,16 +98798,16 @@ var require_cache5 = __commonJS({ const response = yield twirpClient.CreateCacheEntry(request2); if (!response.ok) { if (response.message) { - core15.warning(`Cache reservation failed: ${response.message}`); + core16.warning(`Cache reservation failed: ${response.message}`); } throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; } catch (error3) { - core15.debug(`Failed to reserve cache: ${error3}`); + core16.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - core15.debug(`Attempting to upload cache located at: ${archivePath}`); + core16.debug(`Attempting to upload cache located at: ${archivePath}`); yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options); const finalizeRequest = { key, @@ -98922,7 +98815,7 @@ var require_cache5 = __commonJS({ sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); - core15.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); + core16.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); if (!finalizeResponse.ok) { if (finalizeResponse.message) { throw new FinalizeCacheError(finalizeResponse.message); @@ -98935,21 +98828,21 @@ var require_cache5 = __commonJS({ if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError2.name) { - core15.info(`Failed to save: ${typedError.message}`); + core16.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { - core15.warning(typedError.message); + core16.warning(typedError.message); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core15.error(`Failed to save: ${typedError.message}`); + core16.error(`Failed to save: ${typedError.message}`); } else { - core15.warning(`Failed to save: ${typedError.message}`); + core16.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core15.debug(`Failed to delete archive: ${error3}`); + core16.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -99176,7 +99069,7 @@ var require_retry_helper = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RetryHelper = void 0; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var RetryHelper = class { constructor(maxAttempts, minSeconds, maxSeconds) { if (maxAttempts < 1) { @@ -99199,10 +99092,10 @@ var require_retry_helper = __commonJS({ if (isRetryable && !isRetryable(err)) { throw err; } - core15.info(err.message); + core16.info(err.message); } const seconds = this.getSleepAmount(); - core15.info(`Waiting ${seconds} seconds before trying again`); + core16.info(`Waiting ${seconds} seconds before trying again`); yield this.sleep(seconds); attempt++; } @@ -99305,7 +99198,7 @@ var require_tool_cache = __commonJS({ exports2.findFromManifest = findFromManifest; exports2.isExplicitVersion = isExplicitVersion; exports2.evaluateVersions = evaluateVersions; - var core15 = __importStar2(require_core()); + var core16 = __importStar2(require_core()); var io7 = __importStar2(require_io()); var crypto3 = __importStar2(require("crypto")); var fs18 = __importStar2(require("fs")); @@ -99334,8 +99227,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { dest = dest || path16.join(_getTempDirectory(), crypto3.randomUUID()); yield io7.mkdirP(path16.dirname(dest)); - core15.debug(`Downloading ${url2}`); - core15.debug(`Destination ${dest}`); + core16.debug(`Downloading ${url2}`); + core16.debug(`Destination ${dest}`); const maxAttempts = 3; const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); @@ -99361,7 +99254,7 @@ var require_tool_cache = __commonJS({ allowRetries: false }); if (auth2) { - core15.debug("set auth"); + core16.debug("set auth"); if (headers === void 0) { headers = {}; } @@ -99370,7 +99263,7 @@ var require_tool_cache = __commonJS({ const response = yield http.get(url2, headers); if (response.message.statusCode !== 200) { const err = new HTTPError2(response.message.statusCode); - core15.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + core16.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } const pipeline = util.promisify(stream2.pipeline); @@ -99379,16 +99272,16 @@ var require_tool_cache = __commonJS({ let succeeded = false; try { yield pipeline(readStream, fs18.createWriteStream(dest)); - core15.debug("download complete"); + core16.debug("download complete"); succeeded = true; return dest; } finally { if (!succeeded) { - core15.debug("download failed"); + core16.debug("download failed"); try { yield io7.rmRF(dest); } catch (err) { - core15.debug(`Failed to delete '${dest}'. ${err.message}`); + core16.debug(`Failed to delete '${dest}'. ${err.message}`); } } } @@ -99403,7 +99296,7 @@ var require_tool_cache = __commonJS({ process.chdir(dest); if (_7zPath) { try { - const logLevel = core15.isDebug() ? "-bb1" : "-bb0"; + const logLevel = core16.isDebug() ? "-bb1" : "-bb0"; const args = [ "x", // eXtract files with full paths @@ -99456,7 +99349,7 @@ var require_tool_cache = __commonJS({ throw new Error("parameter 'file' is required"); } dest = yield _createExtractFolder(dest); - core15.debug("Checking tar --version"); + core16.debug("Checking tar --version"); let versionOutput = ""; yield (0, exec_1.exec)("tar --version", [], { ignoreReturnCode: true, @@ -99466,7 +99359,7 @@ var require_tool_cache = __commonJS({ stderr: (data) => versionOutput += data.toString() } }); - core15.debug(versionOutput.trim()); + core16.debug(versionOutput.trim()); const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); let args; if (flags instanceof Array) { @@ -99474,7 +99367,7 @@ var require_tool_cache = __commonJS({ } else { args = [flags]; } - if (core15.isDebug() && !flags.includes("v")) { + if (core16.isDebug() && !flags.includes("v")) { args.push("-v"); } let destArg = dest; @@ -99505,7 +99398,7 @@ var require_tool_cache = __commonJS({ args = [flags]; } args.push("-x", "-C", dest, "-f", file); - if (core15.isDebug()) { + if (core16.isDebug()) { args.push("-v"); } const xarPath = yield io7.which("xar", true); @@ -99548,7 +99441,7 @@ var require_tool_cache = __commonJS({ "-Command", pwshCommand ]; - core15.debug(`Using pwsh at path: ${pwshPath}`); + core16.debug(`Using pwsh at path: ${pwshPath}`); yield (0, exec_1.exec)(`"${pwshPath}"`, args); } else { const powershellCommand = [ @@ -99568,7 +99461,7 @@ var require_tool_cache = __commonJS({ powershellCommand ]; const powershellPath = yield io7.which("powershell", true); - core15.debug(`Using powershell at path: ${powershellPath}`); + core16.debug(`Using powershell at path: ${powershellPath}`); yield (0, exec_1.exec)(`"${powershellPath}"`, args); } }); @@ -99577,7 +99470,7 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const unzipPath = yield io7.which("unzip", true); const args = [file]; - if (!core15.isDebug()) { + if (!core16.isDebug()) { args.unshift("-q"); } args.unshift("-o"); @@ -99588,8 +99481,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os5.arch(); - core15.debug(`Caching tool ${tool} ${version} ${arch2}`); - core15.debug(`source dir: ${sourceDir}`); + core16.debug(`Caching tool ${tool} ${version} ${arch2}`); + core16.debug(`source dir: ${sourceDir}`); if (!fs18.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } @@ -99606,14 +99499,14 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os5.arch(); - core15.debug(`Caching tool ${tool} ${version} ${arch2}`); - core15.debug(`source file: ${sourceFile}`); + core16.debug(`Caching tool ${tool} ${version} ${arch2}`); + core16.debug(`source file: ${sourceFile}`); if (!fs18.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); const destPath = path16.join(destFolder, targetFile); - core15.debug(`destination file ${destPath}`); + core16.debug(`destination file ${destPath}`); yield io7.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); return destFolder; @@ -99636,12 +99529,12 @@ var require_tool_cache = __commonJS({ if (versionSpec) { versionSpec = semver9.clean(versionSpec) || ""; const cachePath = path16.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core15.debug(`checking cache: ${cachePath}`); + core16.debug(`checking cache: ${cachePath}`); if (fs18.existsSync(cachePath) && fs18.existsSync(`${cachePath}.complete`)) { - core15.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + core16.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { - core15.debug("not found"); + core16.debug("not found"); } } return toolPath; @@ -99670,7 +99563,7 @@ var require_tool_cache = __commonJS({ const http = new httpm.HttpClient("tool-cache"); const headers = {}; if (auth2) { - core15.debug("set auth"); + core16.debug("set auth"); headers.authorization = auth2; } const response = yield http.getJson(treeUrl, headers); @@ -99691,7 +99584,7 @@ var require_tool_cache = __commonJS({ try { releases = JSON.parse(versionsRaw); } catch (_a) { - core15.debug("Invalid json"); + core16.debug("Invalid json"); } } return releases; @@ -99715,7 +99608,7 @@ var require_tool_cache = __commonJS({ function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); - core15.debug(`destination ${folderPath}`); + core16.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io7.rmRF(folderPath); yield io7.rmRF(markerPath); @@ -99727,18 +99620,18 @@ var require_tool_cache = __commonJS({ const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; fs18.writeFileSync(markerPath, ""); - core15.debug("finished caching tool"); + core16.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { const c = semver9.clean(versionSpec) || ""; - core15.debug(`isExplicit: ${c}`); + core16.debug(`isExplicit: ${c}`); const valid3 = semver9.valid(c) != null; - core15.debug(`explicit? ${valid3}`); + core16.debug(`explicit? ${valid3}`); return valid3; } function evaluateVersions(versions, versionSpec) { let version = ""; - core15.debug(`evaluating ${versions.length} versions`); + core16.debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver9.gt(a, b)) { return 1; @@ -99754,9 +99647,9 @@ var require_tool_cache = __commonJS({ } } if (version) { - core15.debug(`matched: ${version}`); + core16.debug(`matched: ${version}`); } else { - core15.debug("match not found"); + core16.debug("match not found"); } return version; } @@ -99940,7 +99833,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -100195,7 +100088,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -100211,7 +100104,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -100238,7 +100131,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url2.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -100310,11 +100203,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -103236,7 +103129,7 @@ module.exports = __toCommonJS(analyze_action_exports); var fs17 = __toESM(require("fs")); var import_path4 = __toESM(require("path")); var import_perf_hooks3 = require("perf_hooks"); -var core14 = __toESM(require_core()); +var core15 = __toESM(require_core()); // src/actions-util.ts var fs2 = __toESM(require("fs")); @@ -105897,6 +105790,16 @@ var safeDump = renamed("safeDump", "dump"); // src/util.ts var semver = __toESM(require_semver2()); + +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isString(value) { + return typeof value === "string"; +} + +// src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; var BROKEN_VERSIONS = ["0.0.0-20211207"]; var GITHUB_DOTCOM_URL = "https://github.com"; @@ -106181,7 +106084,7 @@ var HTTPError = class extends Error { var ConfigurationError = class extends Error { }; function asHTTPError(arg) { - if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { + if (!isObject2(arg) || !isString(arg.message)) { return void 0; } if (Number.isInteger(arg.status)) { @@ -106393,7 +106296,6 @@ function unsafeEntriesInvariant(object) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -106410,7 +106312,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -106782,6 +106684,7 @@ function parseRepositoryNwo(input) { // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -106796,10 +106699,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -107232,6 +107132,7 @@ var semver2 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -107559,6 +107460,12 @@ async function isAnalyzingDefaultBranch() { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -107835,70 +107742,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -107910,25 +107795,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -107938,23 +107818,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -107970,11 +107840,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -107992,11 +107859,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -108613,28 +108475,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; function getPathToParsedConfigFile(tempDir) { return path7.join(tempDir, "config"); @@ -110959,13 +110813,6 @@ async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetai await withGroupAsync("Cleaning up databases", async () => { await codeql.databaseCleanupCluster(config, cleanupLevel); }); - const client = getApiClient(); - const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url)); - uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`; - let uploadsBaseUrl = uploadsUrl.toString(); - if (uploadsBaseUrl.endsWith("/")) { - uploadsBaseUrl = uploadsBaseUrl.slice(0, -1); - } const reports = []; for (const language of config.languages) { let bundledDbSize = void 0; @@ -110974,40 +110821,47 @@ async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetai includeDiagnostics: false }); bundledDbSize = fs13.statSync(bundledDb).size; - const bundledDbReadStream = fs13.createReadStream(bundledDb); const commitOid = await getCommitOid( getRequiredInput("checkout_path") ); - try { - const startTime = performance.now(); - await client.request( - `POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, - { - baseUrl: uploadsBaseUrl, - owner: repositoryNwo.owner, - repo: repositoryNwo.repo, + const maxAttempts = 4; + let uploadDurationMs; + for (let attempt = 1; attempt <= maxAttempts; attempt++) { + try { + uploadDurationMs = await uploadBundledDatabase( + repositoryNwo, language, - name: `${language}-database`, - commit_oid: commitOid, - data: bundledDbReadStream, - headers: { - authorization: `token ${apiDetails.auth}`, - "Content-Type": "application/zip", - "Content-Length": bundledDbSize - } + commitOid, + bundledDb, + bundledDbSize, + apiDetails + ); + break; + } catch (e) { + const httpError = asHTTPError(e); + const isRetryable = !httpError || !DO_NOT_RETRY_STATUSES.includes(httpError.status); + if (!isRetryable) { + throw e; + } else if (attempt === maxAttempts) { + logger.error( + `Maximum retry attempts exhausted (${attempt}), aborting database upload` + ); + throw e; } - ); - const endTime = performance.now(); - reports.push({ - language, - zipped_upload_size_bytes: bundledDbSize, - is_overlay_base: shouldUploadOverlayBase, - upload_duration_ms: endTime - startTime - }); - logger.debug(`Successfully uploaded database for ${language}`); - } finally { - bundledDbReadStream.close(); + const backoffMs = 15e3 * Math.pow(2, attempt - 1); + logger.debug( + `Database upload attempt ${attempt} of ${maxAttempts} failed for ${language}: ${getErrorMessage(e)}. Retrying in ${backoffMs / 1e3}s...` + ); + await new Promise((resolve8) => setTimeout(resolve8, backoffMs)); + } } + reports.push({ + language, + zipped_upload_size_bytes: bundledDbSize, + is_overlay_base: shouldUploadOverlayBase, + upload_duration_ms: uploadDurationMs + }); + logger.debug(`Successfully uploaded database for ${language}`); } catch (e) { logger.warning( `Failed to upload database for ${language}: ${getErrorMessage(e)}` @@ -111021,6 +110875,43 @@ async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetai } return reports; } +async function uploadBundledDatabase(repositoryNwo, language, commitOid, bundledDb, bundledDbSize, apiDetails) { + const client = getApiClient(); + const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url)); + uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`; + let uploadsBaseUrl = uploadsUrl.toString(); + if (uploadsBaseUrl.endsWith("/")) { + uploadsBaseUrl = uploadsBaseUrl.slice(0, -1); + } + const bundledDbReadStream = fs13.createReadStream(bundledDb); + try { + const startTime = performance.now(); + await client.request( + `POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, + { + baseUrl: uploadsBaseUrl, + owner: repositoryNwo.owner, + repo: repositoryNwo.repo, + language, + name: `${language}-database`, + commit_oid: commitOid, + data: bundledDbReadStream, + headers: { + authorization: `token ${apiDetails.auth}`, + "Content-Type": "application/zip", + "Content-Length": bundledDbSize + }, + // Disable `octokit/plugin-retry.js`, since the request body is a ReadStream which can only be consumed once. + request: { + retries: 0 + } + } + ); + return performance.now() - startTime; + } finally { + bundledDbReadStream.close(); + } +} // src/status-report.ts var os4 = __toESM(require("os")); @@ -111234,7 +111125,7 @@ var fs16 = __toESM(require("fs")); var path14 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); -var core13 = __toESM(require_core()); +var core14 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib2()); // src/fingerprints.ts @@ -112264,7 +112155,7 @@ function locationUpdateCallback(result, location, logger) { } function resolveUriToFile(location, artifacts, sourceRoot, logger) { if (!location.uri && location.index !== void 0) { - if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") { + if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || !isObject2(artifacts[location.index].location)) { logger.debug(`Ignoring location as index "${location.index}" is invalid`); return void 0; } @@ -112360,7 +112251,9 @@ async function addFingerprints(sarifLog, sourceRoot, logger) { } // src/init.ts +var core13 = __toESM(require_core()); var toolrunner4 = __toESM(require_toolrunner()); +var github2 = __toESM(require_github()); var io6 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); @@ -112465,10 +112358,7 @@ function areAllRunsUnique(sarifLogs) { // src/upload-lib.ts var GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning."; var GENERIC_404_MSG = "The CodeQL code scanning feature is forbidden on this repository."; -async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) { - if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { - return false; - } +async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects) { return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING; } async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) { @@ -112501,14 +112391,11 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo logger.debug( "Not all SARIF files were produced by CodeQL. Merging files in the action." ); - if (await shouldShowCombineSarifFilesDeprecationWarning( - sarifObjects, - gitHubVersion - )) { + if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects)) { logger.warning( `Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}` ); - core13.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); + core14.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); } return combineSarifFiles(sarifFiles, logger); } @@ -112607,13 +112494,13 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { if (httpError !== void 0) { switch (httpError.status) { case 403: - core13.warning(httpError.message || GENERIC_403_MSG); + core14.warning(httpError.message || GENERIC_403_MSG); break; case 404: - core13.warning(httpError.message || GENERIC_404_MSG); + core14.warning(httpError.message || GENERIC_404_MSG); break; default: - core13.warning(httpError.message); + core14.warning(httpError.message); break; } } @@ -113000,7 +112887,7 @@ function validateUniqueCategory(sarifLog, sentinelPrefix) { `Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. The easiest fix is to specify a unique value for the \`category\` input. If .runs[].automationDetails.id is specified in the sarif file, that will take precedence over your configured \`category\`. Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})` ); } - core13.exportVariable(sentinelEnvVar, sentinelEnvVar); + core14.exportVariable(sentinelEnvVar, sentinelEnvVar); } } function sanitize(str2) { @@ -113217,7 +113104,7 @@ async function run(startedAt2) { } const apiDetails = getApiDetails(); const outputDir = getRequiredInput("output"); - core14.exportVariable("CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR" /* SARIF_RESULTS_OUTPUT_DIR */, outputDir); + core15.exportVariable("CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR" /* SARIF_RESULTS_OUTPUT_DIR */, outputDir); const threads = getThreadsFlag( getOptionalInput("threads") || process.env["CODEQL_THREADS"], logger @@ -113274,8 +113161,8 @@ async function run(startedAt2) { for (const language of config.languages) { dbLocations[language] = getCodeQLDatabasePath(config, language); } - core14.setOutput("db-locations", dbLocations); - core14.setOutput("sarif-output", import_path4.default.resolve(outputDir)); + core15.setOutput("db-locations", dbLocations); + core15.setOutput("sarif-output", import_path4.default.resolve(outputDir)); const uploadKind = getUploadValue( getOptionalInput("upload") ); @@ -113292,13 +113179,13 @@ async function run(startedAt2) { getOptionalInput("post-processed-sarif-path") ); if (uploadResults["code-scanning" /* CodeScanning */] !== void 0) { - core14.setOutput( + core15.setOutput( "sarif-id", uploadResults["code-scanning" /* CodeScanning */].sarifID ); } if (uploadResults["code-quality" /* CodeQuality */] !== void 0) { - core14.setOutput( + core15.setOutput( "quality-sarif-id", uploadResults["code-quality" /* CodeQuality */].sarifID ); @@ -113341,15 +113228,15 @@ async function run(startedAt2) { ); } if (getOptionalInput("expect-error") === "true") { - core14.setFailed( + core15.setFailed( `expect-error input was set to true but no error was thrown.` ); } - core14.exportVariable("CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */, "true"); + core15.exportVariable("CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */, "true"); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); if (getOptionalInput("expect-error") !== "true" || hasBadExpectErrorInput()) { - core14.setFailed(error3.message); + core15.setFailed(error3.message); } await sendStatusReport2( startedAt2, @@ -113420,7 +113307,7 @@ async function runWrapper() { try { await runPromise; } catch (error3) { - core14.setFailed(`analyze action failed: ${getErrorMessage(error3)}`); + core15.setFailed(`analyze action failed: ${getErrorMessage(error3)}`); await sendUnhandledErrorStatusReport( "finish" /* Analyze */, startedAt, diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 885b9a9596..1564b1662b 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -53394,8 +53287,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -57881,7 +57774,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -57928,7 +57821,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID() { @@ -92763,7 +92656,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -92835,7 +92728,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -99940,7 +99833,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -100195,7 +100088,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -100211,7 +100104,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -100238,7 +100131,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -100310,11 +100203,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -102995,6 +102888,14 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.21"; var minimumVersion = "3.14"; +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isString(value) { + return typeof value === "string"; +} + // src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; var GITHUB_DOTCOM_URL = "https://github.com"; @@ -103102,7 +103003,7 @@ var HTTPError = class extends Error { var ConfigurationError = class extends Error { }; function asHTTPError(arg) { - if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { + if (!isObject2(arg) || !isString(arg.message)) { return void 0; } if (Number.isInteger(arg.status)) { @@ -103200,7 +103101,6 @@ async function asyncSome(array, predicate) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -103217,7 +103117,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -103423,6 +103323,7 @@ function parseRepositoryNwo(input) { // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -103437,10 +103338,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -103786,6 +103684,7 @@ var semver2 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -103995,6 +103894,12 @@ async function isAnalyzingDefaultBranch() { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -104135,70 +104040,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -104210,25 +104093,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -104238,23 +104116,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -104270,11 +104138,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -104292,11 +104157,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -104640,28 +104500,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; function getPathToParsedConfigFile(tempDir) { return path4.join(tempDir, "config"); diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 9640bc09de..5504bfece0 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -1337,14 +1337,14 @@ var require_util = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path18 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path19 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path18 && path18[0] !== "/") { - path18 = `/${path18}`; + if (path19 && path19[0] !== "/") { + path19 = `/${path19}`; } - return new URL(`${origin}${path18}`); + return new URL(`${origin}${path19}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1795,39 +1795,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path18, origin } + request: { method, path: path19, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path18); + debuglog("sending request to %s %s/%s", method, origin, path19); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path18, origin }, + request: { method, path: path19, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path18, + path19, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path18, origin } + request: { method, path: path19, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path18); + debuglog("trailers received from %s %s/%s", method, origin, path19); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path18, origin }, + request: { method, path: path19, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path18, + path19, error3.message ); }); @@ -1876,9 +1876,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path18, origin } + request: { method, path: path19, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path18); + debuglog("sending request to %s %s/%s", method, origin, path19); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1941,7 +1941,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path18, + path: path19, method, body, headers, @@ -1956,11 +1956,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path18 !== "string") { + if (typeof path19 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path18[0] !== "/" && !(path18.startsWith("http://") || path18.startsWith("https://")) && method !== "CONNECT") { + } else if (path19[0] !== "/" && !(path19.startsWith("http://") || path19.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path18)) { + } else if (invalidPathRegex.test(path19)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -2023,7 +2023,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path18, query) : path18; + this.path = query ? buildURL(path19, query) : path19; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -3842,18 +3842,18 @@ var require_webidl = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context3) { - const plural = context3.types.length === 1 ? "" : " one of"; - const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context4) { + const plural = context4.types.length === 1 ? "" : " one of"; + const message = `${context4.argument} could not be converted to${plural}: ${context4.types.join(", ")}.`; return webidl.errors.exception({ - header: context3.prefix, + header: context4.prefix, message }); }; - webidl.errors.invalidArgument = function(context3) { + webidl.errors.invalidArgument = function(context4) { return webidl.errors.exception({ - header: context3.prefix, - message: `"${context3.value}" is an invalid ${context3.type}.` + header: context4.prefix, + message: `"${context4.value}" is an invalid ${context4.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -6536,7 +6536,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path18, host, upgrade, blocking, reset } = request2; + const { method, path: path19, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -6602,7 +6602,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path18} HTTP/1.1\r + let header = `${method} ${path19} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -7128,7 +7128,7 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path18, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path19, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -7195,7 +7195,7 @@ var require_client_h2 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path18; + headers[HTTP2_HEADER_PATH] = path19; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -7548,9 +7548,9 @@ var require_redirect_handler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path18 = search ? `${pathname}${search}` : pathname; + const path19 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path18; + this.opts.path = path19; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -8784,10 +8784,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path18 = "/", + path: path19 = "/", headers = {} } = opts; - opts.path = origin + path18; + opts.path = origin + path19; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -9849,17 +9849,17 @@ var require_api_request = __commonJS({ } } } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context4, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -9896,7 +9896,7 @@ var require_api_request = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context3 + context: context4 }); } } @@ -10065,17 +10065,17 @@ var require_api_stream = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context3, callback, responseHeaders } = this; + const { factory, opaque, context: context4, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -10103,7 +10103,7 @@ var require_api_stream = __commonJS({ statusCode, headers, opaque, - context: context3 + context: context4 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -10295,7 +10295,7 @@ var require_api_pipeline = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -10304,10 +10304,10 @@ var require_api_pipeline = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context3 } = this; + const { opaque, handler: handler2, context: context4 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10325,7 +10325,7 @@ var require_api_pipeline = __commonJS({ headers, opaque, body: this.res, - context: context3 + context: context4 }); } catch (err) { this.res.on("error", util.nop); @@ -10409,7 +10409,7 @@ var require_api_upgrade = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; @@ -10423,7 +10423,7 @@ var require_api_upgrade = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10431,7 +10431,7 @@ var require_api_upgrade = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -10500,20 +10500,20 @@ var require_api_connect = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -10525,7 +10525,7 @@ var require_api_connect = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -10708,20 +10708,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path18) { - if (typeof path18 !== "string") { - return path18; + function safeUrl(path19) { + if (typeof path19 !== "string") { + return path19; } - const pathSegments = path18.split("?"); + const pathSegments = path19.split("?"); if (pathSegments.length !== 2) { - return path18; + return path19; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path18, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path18); + function matchKey(mockDispatch2, { path: path19, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path19); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10743,7 +10743,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path18 }) => matchValue(safeUrl(path18), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path19 }) => matchValue(safeUrl(path19), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10781,9 +10781,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path18, method, body, headers, query } = opts; + const { path: path19, method, body, headers, query } = opts; return { - path: path18, + path: path19, method, body, headers, @@ -11246,10 +11246,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path18, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path19, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path18, + Path: path19, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -16130,9 +16130,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path18) { - for (let i = 0; i < path18.length; ++i) { - const code = path18.charCodeAt(i); + function validateCookiePath(path19) { + for (let i = 0; i < path19.length; ++i) { + const code = path19.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -18726,11 +18726,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path18 = opts.path; + let path19 = opts.path; if (!opts.path.startsWith("/")) { - path18 = `/${path18}`; + path19 = `/${path19}`; } - url2 = new URL(util.parseOrigin(url2).origin + path18); + url2 = new URL(util.parseOrigin(url2).origin + path19); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -20033,7 +20033,7 @@ var require_path_utils = __commonJS({ exports2.toPosixPath = toPosixPath; exports2.toWin32Path = toWin32Path; exports2.toPlatformPath = toPlatformPath; - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -20041,7 +20041,7 @@ var require_path_utils = __commonJS({ return pth.replace(/[/]/g, "\\"); } function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path18.sep); + return pth.replace(/[/\\]/g, path19.sep); } } }); @@ -20124,7 +20124,7 @@ var require_io_util = __commonJS({ exports2.tryGetExecutablePath = tryGetExecutablePath; exports2.getCmdPath = getCmdPath; var fs20 = __importStar2(require("fs")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); _a = fs20.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; function readlink(fsPath) { @@ -20179,7 +20179,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path18.extname(filePath).toUpperCase(); + const upperExt = path19.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -20203,11 +20203,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path18.dirname(filePath); - const upperName = path18.basename(filePath).toUpperCase(); + const directory = path19.dirname(filePath); + const upperName = path19.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path18.join(directory, actualName); + filePath = path19.join(directory, actualName); break; } } @@ -20319,7 +20319,7 @@ var require_io = __commonJS({ exports2.which = which7; exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util()); function cp(source_1, dest_1) { return __awaiter2(this, arguments, void 0, function* (source, dest, options = {}) { @@ -20328,7 +20328,7 @@ var require_io = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path18.join(dest, path18.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path19.join(dest, path19.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -20340,7 +20340,7 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path18.relative(source, newDest) === "") { + if (path19.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -20352,7 +20352,7 @@ var require_io = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path18.join(dest, path18.basename(source)); + dest = path19.join(dest, path19.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -20363,7 +20363,7 @@ var require_io = __commonJS({ } } } - yield mkdirP(path18.dirname(dest)); + yield mkdirP(path19.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -20422,7 +20422,7 @@ var require_io = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path18.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path19.delimiter)) { if (extension) { extensions.push(extension); } @@ -20435,12 +20435,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path18.sep)) { + if (tool.includes(path19.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path18.delimiter)) { + for (const p of process.env.PATH.split(path19.delimiter)) { if (p) { directories.push(p); } @@ -20448,7 +20448,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path18.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path19.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -20578,7 +20578,7 @@ var require_toolrunner = __commonJS({ var os4 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var io7 = __importStar2(require_io()); var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); @@ -20793,7 +20793,7 @@ var require_toolrunner = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path18.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path19.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io7.which(this.toolPath, true); return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { @@ -21321,7 +21321,7 @@ var require_core = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; - exports2.exportVariable = exportVariable9; + exports2.exportVariable = exportVariable10; exports2.setSecret = setSecret; exports2.addPath = addPath; exports2.getInput = getInput2; @@ -21346,14 +21346,14 @@ var require_core = __commonJS({ var file_command_1 = require_file_command(); var utils_1 = require_utils(); var os4 = __importStar2(require("os")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils(); var ExitCode; (function(ExitCode2) { ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable9(name, val) { + function exportVariable10(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; @@ -21372,7 +21372,7 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path18.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path19.delimiter}${process.env["PATH"]}`; } function getInput2(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; @@ -21509,8 +21509,8 @@ var require_context = __commonJS({ if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path18 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path18} does not exist${os_1.EOL}`); + const path19 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path19} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -22335,14 +22335,14 @@ var require_util9 = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path18 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path19 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path18 && path18[0] !== "/") { - path18 = `/${path18}`; + if (path19 && path19[0] !== "/") { + path19 = `/${path19}`; } - return new URL(`${origin}${path18}`); + return new URL(`${origin}${path19}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -22793,39 +22793,39 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path18, origin } + request: { method, path: path19, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path18); + debuglog("sending request to %s %s/%s", method, origin, path19); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path18, origin }, + request: { method, path: path19, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path18, + path19, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path18, origin } + request: { method, path: path19, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path18); + debuglog("trailers received from %s %s/%s", method, origin, path19); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path18, origin }, + request: { method, path: path19, origin }, error: error3 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path18, + path19, error3.message ); }); @@ -22874,9 +22874,9 @@ var require_diagnostics2 = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path18, origin } + request: { method, path: path19, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path18); + debuglog("sending request to %s %s/%s", method, origin, path19); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -22939,7 +22939,7 @@ var require_request3 = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path18, + path: path19, method, body, headers, @@ -22954,11 +22954,11 @@ var require_request3 = __commonJS({ expectContinue, servername }, handler2) { - if (typeof path18 !== "string") { + if (typeof path19 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path18[0] !== "/" && !(path18.startsWith("http://") || path18.startsWith("https://")) && method !== "CONNECT") { + } else if (path19[0] !== "/" && !(path19.startsWith("http://") || path19.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path18)) { + } else if (invalidPathRegex.test(path19)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -23021,7 +23021,7 @@ var require_request3 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path18, query) : path18; + this.path = query ? buildURL(path19, query) : path19; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -24840,18 +24840,18 @@ var require_webidl2 = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context3) { - const plural = context3.types.length === 1 ? "" : " one of"; - const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context4) { + const plural = context4.types.length === 1 ? "" : " one of"; + const message = `${context4.argument} could not be converted to${plural}: ${context4.types.join(", ")}.`; return webidl.errors.exception({ - header: context3.prefix, + header: context4.prefix, message }); }; - webidl.errors.invalidArgument = function(context3) { + webidl.errors.invalidArgument = function(context4) { return webidl.errors.exception({ - header: context3.prefix, - message: `"${context3.value}" is an invalid ${context3.type}.` + header: context4.prefix, + message: `"${context4.value}" is an invalid ${context4.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -27534,7 +27534,7 @@ var require_client_h12 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request2) { - const { method, path: path18, host, upgrade, blocking, reset } = request2; + const { method, path: path19, host, upgrade, blocking, reset } = request2; let { body, headers, contentLength } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util.isFormDataLike(body)) { @@ -27600,7 +27600,7 @@ var require_client_h12 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path18} HTTP/1.1\r + let header = `${method} ${path19} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -28126,7 +28126,7 @@ var require_client_h22 = __commonJS({ } function writeH2(client, request2) { const session = client[kHTTP2Session]; - const { method, path: path18, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { method, path: path19, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let { body } = request2; if (upgrade) { util.errorRequest(client, request2, new Error("Upgrade not supported for H2")); @@ -28193,7 +28193,7 @@ var require_client_h22 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path18; + headers[HTTP2_HEADER_PATH] = path19; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -28546,9 +28546,9 @@ var require_redirect_handler2 = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path18 = search ? `${pathname}${search}` : pathname; + const path19 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path18; + this.opts.path = path19; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -29782,10 +29782,10 @@ var require_proxy_agent2 = __commonJS({ }; const { origin, - path: path18 = "/", + path: path19 = "/", headers = {} } = opts; - opts.path = origin + path18; + opts.path = origin + path19; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL2(origin); headers.host = host; @@ -30847,17 +30847,17 @@ var require_api_request2 = __commonJS({ } } } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context4, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -30894,7 +30894,7 @@ var require_api_request2 = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context3 + context: context4 }); } } @@ -31063,17 +31063,17 @@ var require_api_stream2 = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context3, callback, responseHeaders } = this; + const { factory, opaque, context: context4, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -31101,7 +31101,7 @@ var require_api_stream2 = __commonJS({ statusCode, headers, opaque, - context: context3 + context: context4 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -31293,7 +31293,7 @@ var require_api_pipeline2 = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -31302,10 +31302,10 @@ var require_api_pipeline2 = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context3 } = this; + const { opaque, handler: handler2, context: context4 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31323,7 +31323,7 @@ var require_api_pipeline2 = __commonJS({ headers, opaque, body: this.res, - context: context3 + context: context4 }); } catch (err) { this.res.on("error", util.nop); @@ -31407,7 +31407,7 @@ var require_api_upgrade2 = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; @@ -31421,7 +31421,7 @@ var require_api_upgrade2 = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31429,7 +31429,7 @@ var require_api_upgrade2 = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -31498,20 +31498,20 @@ var require_api_connect2 = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -31523,7 +31523,7 @@ var require_api_connect2 = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -31706,20 +31706,20 @@ var require_mock_utils2 = __commonJS({ } return true; } - function safeUrl(path18) { - if (typeof path18 !== "string") { - return path18; + function safeUrl(path19) { + if (typeof path19 !== "string") { + return path19; } - const pathSegments = path18.split("?"); + const pathSegments = path19.split("?"); if (pathSegments.length !== 2) { - return path18; + return path19; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path18, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path18); + function matchKey(mockDispatch2, { path: path19, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path19); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -31741,7 +31741,7 @@ var require_mock_utils2 = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path18 }) => matchValue(safeUrl(path18), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path19 }) => matchValue(safeUrl(path19), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -31779,9 +31779,9 @@ var require_mock_utils2 = __commonJS({ } } function buildKey(opts) { - const { path: path18, method, body, headers, query } = opts; + const { path: path19, method, body, headers, query } = opts; return { - path: path18, + path: path19, method, body, headers, @@ -32244,10 +32244,10 @@ var require_pending_interceptors_formatter2 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path18, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path19, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path18, + Path: path19, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -37128,9 +37128,9 @@ var require_util14 = __commonJS({ } } } - function validateCookiePath(path18) { - for (let i = 0; i < path18.length; ++i) { - const code = path18.charCodeAt(i); + function validateCookiePath(path19) { + for (let i = 0; i < path19.length; ++i) { + const code = path19.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -39724,11 +39724,11 @@ var require_undici2 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path18 = opts.path; + let path19 = opts.path; if (!opts.path.startsWith("/")) { - path18 = `/${path18}`; + path19 = `/${path19}`; } - url2 = new URL(util.parseOrigin(url2).origin + path18); + url2 = new URL(util.parseOrigin(url2).origin + path19); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -40178,8 +40178,8 @@ function isDefined(value) { function isKeyOperator(operator) { return operator === ";" || operator === "&" || operator === "?"; } -function getValues(context3, operator, key, modifier) { - var value = context3[key], result = []; +function getValues(context4, operator, key, modifier) { + var value = context4[key], result = []; if (isDefined(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); @@ -40243,7 +40243,7 @@ function parseUrl(template) { expand: expand.bind(null, template) }; } -function expand(template, context3) { +function expand(template, context4) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, @@ -40257,7 +40257,7 @@ function expand(template, context3) { } expression.split(/,/g).forEach(function(variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context3, operator, tmp[1], tmp[2] || tmp[3])); + values.push(getValues(context4, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -46428,7 +46321,7 @@ var require_light = __commonJS({ } return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } - async doExecute(chained, clearGlobalState, run3, free) { + async doExecute(chained, clearGlobalState, run2, free) { var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); @@ -46448,10 +46341,10 @@ var require_light = __commonJS({ } } catch (error1) { error3 = error1; - return this._onFailure(error3, eventInfo, clearGlobalState, run3, free); + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } } - doExpire(clearGlobalState, run3, free) { + doExpire(clearGlobalState, run2, free) { var error3, eventInfo; if (this._states.jobStatus(this.options.id === "RUNNING")) { this._states.next(this.options.id); @@ -46459,9 +46352,9 @@ var require_light = __commonJS({ this._assertStatus("EXECUTING"); eventInfo = { args: this.args, options: this.options, retryCount: this.retryCount }; error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error3, eventInfo, clearGlobalState, run3, free); + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } - async _onFailure(error3, eventInfo, clearGlobalState, run3, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run2, free) { var retry2, retryAfter; if (clearGlobalState()) { retry2 = await this.Events.trigger("failed", error3, eventInfo); @@ -46469,7 +46362,7 @@ var require_light = __commonJS({ retryAfter = ~~retry2; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); this.retryCount++; - return run3(retryAfter); + return run2(retryAfter); } else { this.doDone(eventInfo); await free(this.options, eventInfo); @@ -47107,17 +47000,17 @@ var require_light = __commonJS({ } } _run(index, job, wait) { - var clearGlobalState, free, run3; + var clearGlobalState, free, run2; job.doRun(); clearGlobalState = this._clearGlobalState.bind(this, index); - run3 = this._run.bind(this, index, job); + run2 = this._run.bind(this, index, job); free = this._free.bind(this, index, job); return this._scheduled[index] = { timeout: setTimeout(() => { - return job.doExecute(this._limiter, clearGlobalState, run3, free); + return job.doExecute(this._limiter, clearGlobalState, run2, free); }, wait), expiration: job.options.expiration != null ? setTimeout(function() { - return job.doExpire(clearGlobalState, run3, free); + return job.doExpire(clearGlobalState, run2, free); }, wait + job.options.expiration) : void 0, job }; @@ -47412,14 +47305,14 @@ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path18, name, argument) { - if (Array.isArray(path18)) { - this.path = path18; - this.property = path18.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path19, name, argument) { + if (Array.isArray(path19)) { + this.path = path19; + this.property = path19.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path18 !== void 0) { - this.property = path18; + } else if (path19 !== void 0) { + this.property = path19; } if (message) { this.message = message; @@ -47510,16 +47403,16 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path18, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path19, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path18)) { - this.path = path18; - this.propertyPath = path18.reduce(function(sum, item) { + if (Array.isArray(path19)) { + this.path = path19; + this.propertyPath = path19.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path18; + this.propertyPath = path19; } this.base = base; this.schemas = schemas; @@ -47528,10 +47421,10 @@ var require_helpers = __commonJS({ return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path18 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path19 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path18, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path19, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -48747,7 +48640,7 @@ var require_internal_glob_options_helper = __commonJS({ })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOptions = getOptions; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); function getOptions(copy) { const result = { followSymbolicLinks: true, @@ -48759,23 +48652,23 @@ var require_internal_glob_options_helper = __commonJS({ if (copy) { if (typeof copy.followSymbolicLinks === "boolean") { result.followSymbolicLinks = copy.followSymbolicLinks; - core17.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + core18.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } if (typeof copy.implicitDescendants === "boolean") { result.implicitDescendants = copy.implicitDescendants; - core17.debug(`implicitDescendants '${result.implicitDescendants}'`); + core18.debug(`implicitDescendants '${result.implicitDescendants}'`); } if (typeof copy.matchDirectories === "boolean") { result.matchDirectories = copy.matchDirectories; - core17.debug(`matchDirectories '${result.matchDirectories}'`); + core18.debug(`matchDirectories '${result.matchDirectories}'`); } if (typeof copy.omitBrokenSymbolicLinks === "boolean") { result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core17.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + core18.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } if (typeof copy.excludeHiddenFiles === "boolean") { result.excludeHiddenFiles = copy.excludeHiddenFiles; - core17.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + core18.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } return result; @@ -48834,7 +48727,7 @@ var require_internal_path_helper = __commonJS({ exports2.hasRoot = hasRoot; exports2.normalizeSeparators = normalizeSeparators; exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; function dirname5(p) { @@ -48842,7 +48735,7 @@ var require_internal_path_helper = __commonJS({ if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { return p; } - let result = path18.dirname(p); + let result = path19.dirname(p); if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { result = safeTrimTrailingSeparator(result); } @@ -48879,7 +48772,7 @@ var require_internal_path_helper = __commonJS({ (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { } else { - root += path18.sep; + root += path19.sep; } return root + itemPath; } @@ -48913,10 +48806,10 @@ var require_internal_path_helper = __commonJS({ return ""; } p = normalizeSeparators(p); - if (!p.endsWith(path18.sep)) { + if (!p.endsWith(path19.sep)) { return p; } - if (p === path18.sep) { + if (p === path19.sep) { return p; } if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { @@ -49261,7 +49154,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch; minimatch.Minimatch = Minimatch; - var path18 = (function() { + var path19 = (function() { try { return require("path"); } catch (e) { @@ -49269,7 +49162,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch.sep = path18.sep; + minimatch.sep = path19.sep; var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand2 = require_brace_expansion(); var plTypes = { @@ -49358,8 +49251,8 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path18.sep !== "/") { - pattern = pattern.split(path18.sep).join("/"); + if (!options.allowWindowsEscape && path19.sep !== "/") { + pattern = pattern.split(path19.sep).join("/"); } this.options = options; this.maxGlobstarRecursion = options.maxGlobstarRecursion !== void 0 ? options.maxGlobstarRecursion : 200; @@ -49730,8 +49623,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path18.sep !== "/") { - f = f.split(path18.sep).join("/"); + if (path19.sep !== "/") { + f = f.split(path19.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -49974,7 +49867,7 @@ var require_internal_path = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Path = void 0; - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var IS_WINDOWS = process.platform === "win32"; @@ -49989,12 +49882,12 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(itemPath, `Parameter 'itemPath' must not be empty`); itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path18.sep); + this.segments = itemPath.split(path19.sep); } else { let remaining = itemPath; let dir = pathHelper.dirname(remaining); while (dir !== remaining) { - const basename2 = path18.basename(remaining); + const basename2 = path19.basename(remaining); this.segments.unshift(basename2); remaining = dir; dir = pathHelper.dirname(remaining); @@ -50012,7 +49905,7 @@ var require_internal_path = __commonJS({ (0, assert_1.default)(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); this.segments.push(segment); } else { - (0, assert_1.default)(!segment.includes(path18.sep), `Parameter 'itemPath' contains unexpected path separators`); + (0, assert_1.default)(!segment.includes(path19.sep), `Parameter 'itemPath' contains unexpected path separators`); this.segments.push(segment); } } @@ -50023,12 +49916,12 @@ var require_internal_path = __commonJS({ */ toString() { let result = this.segments[0]; - let skipSlash = result.endsWith(path18.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + let skipSlash = result.endsWith(path19.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); for (let i = 1; i < this.segments.length; i++) { if (skipSlash) { skipSlash = false; } else { - result += path18.sep; + result += path19.sep; } result += this.segments[i]; } @@ -50086,7 +49979,7 @@ var require_internal_pattern = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; var os4 = __importStar2(require("os")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var pathHelper = __importStar2(require_internal_path_helper()); var assert_1 = __importDefault2(require("assert")); var minimatch_1 = require_minimatch(); @@ -50115,7 +50008,7 @@ var require_internal_pattern = __commonJS({ } pattern = _Pattern.fixupPattern(pattern, homedir); this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path18.sep); + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path19.sep); pattern = pathHelper.safeTrimTrailingSeparator(pattern); let foundGlob = false; const searchSegments = this.segments.map((x) => _Pattern.getLiteral(x)).filter((x) => !foundGlob && !(foundGlob = x === "")); @@ -50139,8 +50032,8 @@ var require_internal_pattern = __commonJS({ match(itemPath) { if (this.segments[this.segments.length - 1] === "**") { itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path18.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path18.sep}`; + if (!itemPath.endsWith(path19.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path19.sep}`; } } else { itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); @@ -50175,9 +50068,9 @@ var require_internal_pattern = __commonJS({ (0, assert_1.default)(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); (0, assert_1.default)(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); pattern = pathHelper.normalizeSeparators(pattern); - if (pattern === "." || pattern.startsWith(`.${path18.sep}`)) { + if (pattern === "." || pattern.startsWith(`.${path19.sep}`)) { pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path18.sep}`)) { + } else if (pattern === "~" || pattern.startsWith(`~${path19.sep}`)) { homedir = homedir || os4.homedir(); (0, assert_1.default)(homedir, "Unable to determine HOME directory"); (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); @@ -50261,8 +50154,8 @@ var require_internal_search_state = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.SearchState = void 0; var SearchState = class { - constructor(path18, level) { - this.path = path18; + constructor(path19, level) { + this.path = path19; this.level = level; } }; @@ -50403,10 +50296,10 @@ var require_internal_globber = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var fs20 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var patternHelper = __importStar2(require_internal_pattern_helper()); var internal_match_kind_1 = require_internal_match_kind(); var internal_pattern_1 = require_internal_pattern(); @@ -50456,7 +50349,7 @@ var require_internal_globber = __commonJS({ } const stack = []; for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core17.debug(`Search path '${searchPath}'`); + core18.debug(`Search path '${searchPath}'`); try { yield __await2(fs20.promises.lstat(searchPath)); } catch (err) { @@ -50482,7 +50375,7 @@ var require_internal_globber = __commonJS({ if (!stats) { continue; } - if (options.excludeHiddenFiles && path18.basename(item.path).match(/^\./)) { + if (options.excludeHiddenFiles && path19.basename(item.path).match(/^\./)) { continue; } if (stats.isDirectory()) { @@ -50492,7 +50385,7 @@ var require_internal_globber = __commonJS({ continue; } const childLevel = item.level + 1; - const childItems = (yield __await2(fs20.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path18.join(item.path, x), childLevel)); + const childItems = (yield __await2(fs20.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path19.join(item.path, x), childLevel)); stack.push(...childItems.reverse()); } else if (match & internal_match_kind_1.MatchKind.File) { yield yield __await2(item.path); @@ -50531,7 +50424,7 @@ var require_internal_globber = __commonJS({ } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { - core17.debug(`Broken symlink '${item.path}'`); + core18.debug(`Broken symlink '${item.path}'`); return void 0; } throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); @@ -50547,7 +50440,7 @@ var require_internal_globber = __commonJS({ traversalChain.pop(); } if (traversalChain.some((x) => x === realPath)) { - core17.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + core18.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); return void 0; } traversalChain.push(realPath); @@ -50650,16 +50543,16 @@ var require_internal_hash_files = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hashFiles = hashFiles2; var crypto2 = __importStar2(require("crypto")); - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var fs20 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); function hashFiles2(globber_1, currentWorkspace_1) { return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; - const writeDelegate = verbose ? core17.info : core17.debug; + const writeDelegate = verbose ? core18.info : core18.debug; let hasMatch = false; const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); const result = crypto2.createHash("sha256"); @@ -50670,7 +50563,7 @@ var require_internal_hash_files = __commonJS({ _e = false; const file = _c; writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path18.sep}`)) { + if (!file.startsWith(`${githubWorkspace}${path19.sep}`)) { writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); continue; } @@ -52050,13 +51943,13 @@ var require_cacheUtils = __commonJS({ exports2.assertDefined = assertDefined; exports2.getCacheVersion = getCacheVersion; exports2.getRuntimeToken = getRuntimeToken; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var exec3 = __importStar2(require_exec()); var glob2 = __importStar2(require_glob()); var io7 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); var fs20 = __importStar2(require("fs")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var semver9 = __importStar2(require_semver3()); var util = __importStar2(require("util")); var constants_1 = require_constants12(); @@ -52076,9 +51969,9 @@ var require_cacheUtils = __commonJS({ baseLocation = "/home"; } } - tempDirectory = path18.join(baseLocation, "actions", "temp"); + tempDirectory = path19.join(baseLocation, "actions", "temp"); } - const dest = path18.join(tempDirectory, crypto2.randomUUID()); + const dest = path19.join(tempDirectory, crypto2.randomUUID()); yield io7.mkdirP(dest); return dest; }); @@ -52100,8 +51993,8 @@ var require_cacheUtils = __commonJS({ _c = _g.value; _e = false; const file = _c; - const relativeFile = path18.relative(workspace, file).replace(new RegExp(`\\${path18.sep}`, "g"), "/"); - core17.debug(`Matched: ${relativeFile}`); + const relativeFile = path19.relative(workspace, file).replace(new RegExp(`\\${path19.sep}`, "g"), "/"); + core18.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); } else { @@ -52129,7 +52022,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { let versionOutput = ""; additionalArgs.push("--version"); - core17.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + core18.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { yield exec3.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, @@ -52140,10 +52033,10 @@ var require_cacheUtils = __commonJS({ } }); } catch (err) { - core17.debug(err.message); + core18.debug(err.message); } versionOutput = versionOutput.trim(); - core17.debug(versionOutput); + core18.debug(versionOutput); return versionOutput; }); } @@ -52151,7 +52044,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); const version = semver9.clean(versionOutput); - core17.debug(`zstd version: ${version}`); + core18.debug(`zstd version: ${version}`); if (versionOutput === "") { return constants_1.CompressionMethod.Gzip; } else { @@ -52276,14 +52169,14 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _2, done = false; for (var i = decorators.length - 1; i >= 0; i--) { - var context3 = {}; - for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; - context3.addInitializer = function(f) { + var context4 = {}; + for (var p in contextIn) context4[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context4.access[p] = contextIn.access[p]; + context4.addInitializer = function(f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context3); + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context4); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); @@ -52627,13 +52520,13 @@ function __disposeResources(env) { } return next(); } -function __rewriteRelativeImportExtension(path18, preserveJsx) { - if (typeof path18 === "string" && /^\.\.?\//.test(path18)) { - return path18.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { +function __rewriteRelativeImportExtension(path19, preserveJsx) { + if (typeof path19 === "string" && /^\.\.?\//.test(path19)) { + return path19.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; }); } - return path18; + return path19; } var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; var init_tslib_es6 = __esm({ @@ -53010,19 +52903,19 @@ var require_logger = __commonJS({ logger: clientLogger }; } - var context3 = createLoggerContext({ + var context4 = createLoggerContext({ logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", namespace: "typeSpecRuntime" }); - exports2.TypeSpecRuntimeLogger = context3.logger; + exports2.TypeSpecRuntimeLogger = context4.logger; function setLogLevel(logLevel) { - context3.setLogLevel(logLevel); + context4.setLogLevel(logLevel); } function getLogLevel() { - return context3.getLogLevel(); + return context4.getLogLevel(); } function createClientLogger(namespace) { - return context3.createClientLogger(namespace); + return context4.createClientLogger(namespace); } } }); @@ -53394,8 +53287,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -57047,8 +56940,8 @@ var require_getClient = __commonJS({ } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = clientOptions.endpoint ?? endpoint2; - const client = (path18, ...args) => { - const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path18, args, { allowInsecureConnection, ...requestOptions }); + const client = (path19, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path19, args, { allowInsecureConnection, ...requestOptions }); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -57268,19 +57161,19 @@ var require_commonjs2 = __commonJS({ exports2.getLogLevel = getLogLevel; exports2.createClientLogger = createClientLogger; var logger_1 = require_internal(); - var context3 = (0, logger_1.createLoggerContext)({ + var context4 = (0, logger_1.createLoggerContext)({ logLevelEnvVarName: "AZURE_LOG_LEVEL", namespace: "azure" }); - exports2.AzureLogger = context3.logger; + exports2.AzureLogger = context4.logger; function setLogLevel(level) { - context3.setLogLevel(level); + context4.setLogLevel(level); } function getLogLevel() { - return context3.getLogLevel(); + return context4.getLogLevel(); } function createClientLogger(namespace) { - return context3.createClientLogger(namespace); + return context4.createClientLogger(namespace); } } }); @@ -57881,7 +57774,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID2; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -57928,7 +57821,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID2() { @@ -58190,14 +58083,14 @@ var require_tracingContext = __commonJS({ namespace: /* @__PURE__ */ Symbol.for("@azure/core-tracing namespace") }; function createTracingContext(options = {}) { - let context3 = new TracingContextImpl(options.parentContext); + let context4 = new TracingContextImpl(options.parentContext); if (options.span) { - context3 = context3.setValue(exports2.knownContextKeys.span, options.span); + context4 = context4.setValue(exports2.knownContextKeys.span, options.span); } if (options.namespace) { - context3 = context3.setValue(exports2.knownContextKeys.namespace, options.namespace); + context4 = context4.setValue(exports2.knownContextKeys.namespace, options.namespace); } - return context3; + return context4; } var TracingContextImpl = class _TracingContextImpl { _contextMap; @@ -58335,8 +58228,8 @@ var require_tracingClient = __commonJS({ span.end(); } } - function withContext(context3, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context3, callback, ...callbackArgs); + function withContext(context4, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context4, callback, ...callbackArgs); } function parseTraceparentHeader(traceparentHeader) { return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); @@ -60919,15 +60812,15 @@ var require_urlHelpers2 = __commonJS({ let isAbsolutePath = false; let requestUrl = replaceAll(baseUri, urlReplacements); if (operationSpec.path) { - let path18 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path18.startsWith("/")) { - path18 = path18.substring(1); + let path19 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path19.startsWith("/")) { + path19 = path19.substring(1); } - if (isAbsoluteUrl(path18)) { - requestUrl = path18; + if (isAbsoluteUrl(path19)) { + requestUrl = path19; isAbsolutePath = true; } else { - requestUrl = appendPath(requestUrl, path18); + requestUrl = appendPath(requestUrl, path19); } } const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); @@ -60973,9 +60866,9 @@ var require_urlHelpers2 = __commonJS({ } const searchStart = pathToAppend.indexOf("?"); if (searchStart !== -1) { - const path18 = pathToAppend.substring(0, searchStart); + const path19 = pathToAppend.substring(0, searchStart); const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path18; + newPath = newPath + path19; if (search) { parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } @@ -63249,10 +63142,10 @@ var require_utils_common = __commonJS({ var constants_js_1 = require_constants15(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path18 = urlParsed.pathname; - path18 = path18 || "/"; - path18 = escape(path18); - urlParsed.pathname = path18; + let path19 = urlParsed.pathname; + path19 = path19 || "/"; + path19 = escape(path19); + urlParsed.pathname = path19; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -63337,9 +63230,9 @@ var require_utils_common = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path18 = urlParsed.pathname; - path18 = path18 ? path18.endsWith("/") ? `${path18}${name}` : `${path18}/${name}` : name; - urlParsed.pathname = path18; + let path19 = urlParsed.pathname; + path19 = path19 ? path19.endsWith("/") ? `${path19}${name}` : `${path19}/${name}` : name; + urlParsed.pathname = path19; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -64566,9 +64459,9 @@ var require_StorageSharedKeyCredentialPolicy = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path18 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path19 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path18}`; + canonicalizedResourceString += `/${this.factory.accountName}${path19}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -65307,10 +65200,10 @@ var require_utils_common2 = __commonJS({ var constants_js_1 = require_constants16(); function escapeURLPath(url2) { const urlParsed = new URL(url2); - let path18 = urlParsed.pathname; - path18 = path18 || "/"; - path18 = escape(path18); - urlParsed.pathname = path18; + let path19 = urlParsed.pathname; + path19 = path19 || "/"; + path19 = escape(path19); + urlParsed.pathname = path19; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -65395,9 +65288,9 @@ var require_utils_common2 = __commonJS({ } function appendToURLPath(url2, name) { const urlParsed = new URL(url2); - let path18 = urlParsed.pathname; - path18 = path18 ? path18.endsWith("/") ? `${path18}${name}` : `${path18}/${name}` : name; - urlParsed.pathname = path18; + let path19 = urlParsed.pathname; + path19 = path19 ? path19.endsWith("/") ? `${path19}${name}` : `${path19}/${name}` : name; + urlParsed.pathname = path19; return urlParsed.toString(); } function setURLParameter(url2, name, value) { @@ -66318,9 +66211,9 @@ var require_StorageSharedKeyCredentialPolicy2 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request2) { - const path18 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path19 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path18}`; + canonicalizedResourceString += `/${this.factory.accountName}${path19}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -66950,9 +66843,9 @@ var require_StorageSharedKeyCredentialPolicyV2 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path18 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path19 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path18}`; + canonicalizedResourceString += `/${options.accountName}${path19}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -67297,9 +67190,9 @@ var require_StorageSharedKeyCredentialPolicyV22 = __commonJS({ return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request2) { - const path18 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; + const path19 = (0, utils_common_js_1.getURLPath)(request2.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path18}`; + canonicalizedResourceString += `/${options.accountName}${path19}`; const queries = (0, utils_common_js_1.getURLQueries)(request2.url); const lowercaseQueries = {}; if (queries) { @@ -88954,8 +88847,8 @@ var require_BlobBatch = __commonJS({ if (this.operationCount >= constants_js_1.BATCH_MAX_REQUEST) { throw new RangeError(`Cannot exceed ${constants_js_1.BATCH_MAX_REQUEST} sub requests in a single batch`); } - const path18 = (0, utils_common_js_1.getURLPath)(subRequest.url); - if (!path18 || path18 === "") { + const path19 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path19 || path19 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -89033,8 +88926,8 @@ var require_BlobBatchClient = __commonJS({ pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); - const path18 = (0, utils_common_js_1.getURLPath)(url2); - if (path18 && path18 !== "/") { + const path19 = (0, utils_common_js_1.getURLPath)(url2); + if (path19 && path19 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -91807,7 +91700,7 @@ var require_uploadUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadProgress = void 0; exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors3(); var UploadProgress = class { @@ -91849,7 +91742,7 @@ var require_uploadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const uploadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core17.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); + core18.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -91906,14 +91799,14 @@ var require_uploadUtils = __commonJS({ }; try { uploadProgress.startDisplayTimer(); - core17.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + core18.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); if (response._response.status >= 400) { throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; } catch (error3) { - core17.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + core18.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); throw error3; } finally { uploadProgress.stopDisplayTimer(); @@ -91998,7 +91891,7 @@ var require_requestUtils = __commonJS({ exports2.retry = retry2; exports2.retryTypedResponse = retryTypedResponse; exports2.retryHttpClientResponse = retryHttpClientResponse; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var http_client_1 = require_lib(); var constants_1 = require_constants12(); function isSuccessStatusCode(statusCode) { @@ -92056,9 +91949,9 @@ var require_requestUtils = __commonJS({ isRetryable = isRetryableStatusCode(statusCode); errorMessage = `Cache service responded with ${statusCode}`; } - core17.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + core18.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); if (!isRetryable) { - core17.debug(`${name} - Error is not retryable`); + core18.debug(`${name} - Error is not retryable`); break; } yield sleep(delay2); @@ -92317,7 +92210,7 @@ var require_downloadUtils = __commonJS({ exports2.downloadCacheHttpClient = downloadCacheHttpClient; exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); @@ -92355,7 +92248,7 @@ var require_downloadUtils = __commonJS({ this.segmentIndex = this.segmentIndex + 1; this.segmentSize = segmentSize; this.receivedBytes = 0; - core17.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); + core18.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** * Sets the number of bytes received for the current segment. @@ -92389,7 +92282,7 @@ var require_downloadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core17.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + core18.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -92439,7 +92332,7 @@ var require_downloadUtils = __commonJS({ })); downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); - core17.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); + core18.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, writeStream); const contentLengthHeader = downloadResponse.message.headers["content-length"]; @@ -92450,7 +92343,7 @@ var require_downloadUtils = __commonJS({ throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { - core17.debug("Unable to validate download, no Content-Length header"); + core18.debug("Unable to validate download, no Content-Length header"); } }); } @@ -92568,7 +92461,7 @@ var require_downloadUtils = __commonJS({ const properties = yield client.getProperties(); const contentLength = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; if (contentLength < 0) { - core17.debug("Unable to determine content length, downloading file with http-client..."); + core18.debug("Unable to determine content length, downloading file with http-client..."); yield downloadCacheHttpClient(archiveLocation, archivePath); } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); @@ -92658,7 +92551,7 @@ var require_options = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadOptions = getUploadOptions; exports2.getDownloadOptions = getDownloadOptions; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -92678,9 +92571,9 @@ var require_options = __commonJS({ } result.uploadConcurrency = !isNaN(Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) ? Math.min(32, Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) : result.uploadConcurrency; result.uploadChunkSize = !isNaN(Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"])) ? Math.min(128 * 1024 * 1024, Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"]) * 1024 * 1024) : result.uploadChunkSize; - core17.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core17.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core17.debug(`Upload chunk size: ${result.uploadChunkSize}`); + core18.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core18.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core18.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } function getDownloadOptions(copy) { @@ -92716,12 +92609,12 @@ var require_options = __commonJS({ if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; } - core17.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core17.debug(`Download concurrency: ${result.downloadConcurrency}`); - core17.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core17.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core17.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core17.debug(`Lookup only: ${result.lookupOnly}`); + core18.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core18.debug(`Download concurrency: ${result.downloadConcurrency}`); + core18.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core18.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core18.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core18.debug(`Lookup only: ${result.lookupOnly}`); return result; } } @@ -92763,7 +92656,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -92835,7 +92728,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -92915,7 +92808,7 @@ var require_cacheHttpClient = __commonJS({ exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; exports2.saveCache = saveCache5; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); var fs20 = __importStar2(require("fs")); @@ -92933,7 +92826,7 @@ var require_cacheHttpClient = __commonJS({ throw new Error("Cache Service Url not found, unable to restore cache."); } const url2 = `${baseUrl}_apis/artifactcache/${resource}`; - core17.debug(`Resource Url: ${url2}`); + core18.debug(`Resource Url: ${url2}`); return url2; } function createAcceptHeader(type2, apiVersion) { @@ -92961,7 +92854,7 @@ var require_cacheHttpClient = __commonJS({ return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { - if (core17.isDebug()) { + if (core18.isDebug()) { yield printCachesListForDiagnostics(keys[0], httpClient, version); } return null; @@ -92974,9 +92867,9 @@ var require_cacheHttpClient = __commonJS({ if (!cacheDownloadUrl) { throw new Error("Cache not found."); } - core17.setSecret(cacheDownloadUrl); - core17.debug(`Cache Result:`); - core17.debug(JSON.stringify(cacheResult)); + core18.setSecret(cacheDownloadUrl); + core18.debug(`Cache Result:`); + core18.debug(JSON.stringify(cacheResult)); return cacheResult; }); } @@ -92990,10 +92883,10 @@ var require_cacheHttpClient = __commonJS({ const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - core17.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + core18.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`); for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { - core17.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); + core18.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); } } } @@ -93036,7 +92929,7 @@ Other caches with similar key:`); } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { return __awaiter2(this, void 0, void 0, function* () { - core17.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); + core18.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); const additionalHeaders = { "Content-Type": "application/octet-stream", "Content-Range": getContentRange(start, end) @@ -93058,7 +92951,7 @@ Other caches with similar key:`); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); const parallelUploads = [...new Array(concurrency).keys()]; - core17.debug("Awaiting all uploads"); + core18.debug("Awaiting all uploads"); let offset = 0; try { yield Promise.all(parallelUploads.map(() => __awaiter2(this, void 0, void 0, function* () { @@ -93101,16 +92994,16 @@ Other caches with similar key:`); yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); } else { const httpClient = createHttpClient(); - core17.debug("Upload cache"); + core18.debug("Upload cache"); yield uploadFile(httpClient, cacheId, archivePath, options); - core17.debug("Commiting cache"); + core18.debug("Commiting cache"); const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core17.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); + core18.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); } - core17.info("Cache saved successfully"); + core18.info("Cache saved successfully"); } }); } @@ -98343,7 +98236,7 @@ var require_tar = __commonJS({ var exec_1 = require_exec(); var io7 = __importStar2(require_io()); var fs_1 = require("fs"); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants12(); var IS_WINDOWS = process.platform === "win32"; @@ -98389,13 +98282,13 @@ var require_tar = __commonJS({ const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; switch (type2) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path19.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path19.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path19.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path18.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path19.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path19.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path19.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -98441,7 +98334,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --long=30 --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path18.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path19.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -98450,7 +98343,7 @@ var require_tar = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path18.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path19.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -98465,7 +98358,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.Zstd: return BSD_TAR_ZSTD ? [ "zstd -T0 --long=30 --force -o", - cacheFileName.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path19.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -98474,7 +98367,7 @@ var require_tar = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path18.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path19.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -98512,7 +98405,7 @@ var require_tar = __commonJS({ } function createTar(archiveFolder, sourceDirectories, compressionMethod) { return __awaiter2(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path18.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + (0, fs_1.writeFileSync)(path19.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); @@ -98593,8 +98486,8 @@ var require_cache5 = __commonJS({ exports2.isFeatureAvailable = isFeatureAvailable; exports2.restoreCache = restoreCache5; exports2.saveCache = saveCache5; - var core17 = __importStar2(require_core()); - var path18 = __importStar2(require("path")); + var core18 = __importStar2(require_core()); + var path19 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); @@ -98652,7 +98545,7 @@ var require_cache5 = __commonJS({ function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core17.debug(`Cache service version: ${cacheServiceVersion}`); + core18.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); switch (cacheServiceVersion) { case "v2": @@ -98667,8 +98560,8 @@ var require_cache5 = __commonJS({ return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core17.debug("Resolved Keys:"); - core17.debug(JSON.stringify(keys)); + core18.debug("Resolved Keys:"); + core18.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -98686,19 +98579,19 @@ var require_cache5 = __commonJS({ return void 0; } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core17.info("Lookup only - skipping download"); + core18.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path18.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core17.debug(`Archive Path: ${archivePath}`); + archivePath = path19.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core18.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core17.isDebug()) { + if (core18.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core17.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + core18.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core17.info("Cache restored successfully"); + core18.info("Cache restored successfully"); return cacheEntry.cacheKey; } catch (error3) { const typedError = error3; @@ -98706,16 +98599,16 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core17.error(`Failed to restore: ${error3.message}`); + core18.error(`Failed to restore: ${error3.message}`); } else { - core17.warning(`Failed to restore: ${error3.message}`); + core18.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core17.debug(`Failed to delete archive: ${error3}`); + core18.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -98726,8 +98619,8 @@ var require_cache5 = __commonJS({ options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core17.debug("Resolved Keys:"); - core17.debug(JSON.stringify(keys)); + core18.debug("Resolved Keys:"); + core18.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -98745,30 +98638,30 @@ var require_cache5 = __commonJS({ }; const response = yield twirpClient.GetCacheEntryDownloadURL(request2); if (!response.ok) { - core17.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); + core18.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); return void 0; } const isRestoreKeyMatch = request2.key !== response.matchedKey; if (isRestoreKeyMatch) { - core17.info(`Cache hit for restore-key: ${response.matchedKey}`); + core18.info(`Cache hit for restore-key: ${response.matchedKey}`); } else { - core17.info(`Cache hit for: ${response.matchedKey}`); + core18.info(`Cache hit for: ${response.matchedKey}`); } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core17.info("Lookup only - skipping download"); + core18.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path18.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core17.debug(`Archive path: ${archivePath}`); - core17.debug(`Starting download of archive to: ${archivePath}`); + archivePath = path19.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core18.debug(`Archive path: ${archivePath}`); + core18.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core17.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core17.isDebug()) { + core18.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core18.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core17.info("Cache restored successfully"); + core18.info("Cache restored successfully"); return response.matchedKey; } catch (error3) { const typedError = error3; @@ -98776,9 +98669,9 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core17.error(`Failed to restore: ${error3.message}`); + core18.error(`Failed to restore: ${error3.message}`); } else { - core17.warning(`Failed to restore: ${error3.message}`); + core18.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -98787,7 +98680,7 @@ var require_cache5 = __commonJS({ yield utils.unlinkFile(archivePath); } } catch (error3) { - core17.debug(`Failed to delete archive: ${error3}`); + core18.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -98796,7 +98689,7 @@ var require_cache5 = __commonJS({ function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core17.debug(`Cache service version: ${cacheServiceVersion}`); + core18.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); checkKey(key); switch (cacheServiceVersion) { @@ -98814,26 +98707,26 @@ var require_cache5 = __commonJS({ const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core17.debug("Cache Paths:"); - core17.debug(`${JSON.stringify(cachePaths)}`); + core18.debug("Cache Paths:"); + core18.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path18.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core17.debug(`Archive Path: ${archivePath}`); + const archivePath = path19.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core18.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core17.isDebug()) { + if (core18.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const fileSizeLimit = 10 * 1024 * 1024 * 1024; const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core17.debug(`File Size: ${archiveFileSize}`); + core18.debug(`File Size: ${archiveFileSize}`); if (archiveFileSize > fileSizeLimit && !(0, config_1.isGhes)()) { throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); } - core17.debug("Reserving Cache"); + core18.debug("Reserving Cache"); const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { compressionMethod, enableCrossOsArchive, @@ -98846,26 +98739,26 @@ var require_cache5 = __commonJS({ } else { throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); } - core17.debug(`Saving Cache (ID: ${cacheId})`); + core18.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); } catch (error3) { const typedError = error3; if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError2.name) { - core17.info(`Failed to save: ${typedError.message}`); + core18.info(`Failed to save: ${typedError.message}`); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core17.error(`Failed to save: ${typedError.message}`); + core18.error(`Failed to save: ${typedError.message}`); } else { - core17.warning(`Failed to save: ${typedError.message}`); + core18.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core17.debug(`Failed to delete archive: ${error3}`); + core18.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -98878,23 +98771,23 @@ var require_cache5 = __commonJS({ const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core17.debug("Cache Paths:"); - core17.debug(`${JSON.stringify(cachePaths)}`); + core18.debug("Cache Paths:"); + core18.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path18.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core17.debug(`Archive Path: ${archivePath}`); + const archivePath = path19.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core18.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core17.isDebug()) { + if (core18.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core17.debug(`File Size: ${archiveFileSize}`); + core18.debug(`File Size: ${archiveFileSize}`); options.archiveSizeBytes = archiveFileSize; - core17.debug("Reserving Cache"); + core18.debug("Reserving Cache"); const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); const request2 = { key, @@ -98905,16 +98798,16 @@ var require_cache5 = __commonJS({ const response = yield twirpClient.CreateCacheEntry(request2); if (!response.ok) { if (response.message) { - core17.warning(`Cache reservation failed: ${response.message}`); + core18.warning(`Cache reservation failed: ${response.message}`); } throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; } catch (error3) { - core17.debug(`Failed to reserve cache: ${error3}`); + core18.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - core17.debug(`Attempting to upload cache located at: ${archivePath}`); + core18.debug(`Attempting to upload cache located at: ${archivePath}`); yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options); const finalizeRequest = { key, @@ -98922,7 +98815,7 @@ var require_cache5 = __commonJS({ sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); - core17.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); + core18.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); if (!finalizeResponse.ok) { if (finalizeResponse.message) { throw new FinalizeCacheError(finalizeResponse.message); @@ -98935,21 +98828,21 @@ var require_cache5 = __commonJS({ if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError2.name) { - core17.info(`Failed to save: ${typedError.message}`); + core18.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { - core17.warning(typedError.message); + core18.warning(typedError.message); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core17.error(`Failed to save: ${typedError.message}`); + core18.error(`Failed to save: ${typedError.message}`); } else { - core17.warning(`Failed to save: ${typedError.message}`); + core18.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core17.debug(`Failed to delete archive: ${error3}`); + core18.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -99176,7 +99069,7 @@ var require_retry_helper = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RetryHelper = void 0; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var RetryHelper = class { constructor(maxAttempts, minSeconds, maxSeconds) { if (maxAttempts < 1) { @@ -99199,10 +99092,10 @@ var require_retry_helper = __commonJS({ if (isRetryable && !isRetryable(err)) { throw err; } - core17.info(err.message); + core18.info(err.message); } const seconds = this.getSleepAmount(); - core17.info(`Waiting ${seconds} seconds before trying again`); + core18.info(`Waiting ${seconds} seconds before trying again`); yield this.sleep(seconds); attempt++; } @@ -99305,13 +99198,13 @@ var require_tool_cache = __commonJS({ exports2.findFromManifest = findFromManifest; exports2.isExplicitVersion = isExplicitVersion; exports2.evaluateVersions = evaluateVersions; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var io7 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); var fs20 = __importStar2(require("fs")); var mm = __importStar2(require_manifest()); var os4 = __importStar2(require("os")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var httpm = __importStar2(require_lib()); var semver9 = __importStar2(require_semver2()); var stream2 = __importStar2(require("stream")); @@ -99332,10 +99225,10 @@ var require_tool_cache = __commonJS({ var userAgent2 = "actions/tool-cache"; function downloadTool2(url2, dest, auth2, headers) { return __awaiter2(this, void 0, void 0, function* () { - dest = dest || path18.join(_getTempDirectory(), crypto2.randomUUID()); - yield io7.mkdirP(path18.dirname(dest)); - core17.debug(`Downloading ${url2}`); - core17.debug(`Destination ${dest}`); + dest = dest || path19.join(_getTempDirectory(), crypto2.randomUUID()); + yield io7.mkdirP(path19.dirname(dest)); + core18.debug(`Downloading ${url2}`); + core18.debug(`Destination ${dest}`); const maxAttempts = 3; const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); @@ -99361,7 +99254,7 @@ var require_tool_cache = __commonJS({ allowRetries: false }); if (auth2) { - core17.debug("set auth"); + core18.debug("set auth"); if (headers === void 0) { headers = {}; } @@ -99370,7 +99263,7 @@ var require_tool_cache = __commonJS({ const response = yield http.get(url2, headers); if (response.message.statusCode !== 200) { const err = new HTTPError2(response.message.statusCode); - core17.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + core18.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } const pipeline = util.promisify(stream2.pipeline); @@ -99379,16 +99272,16 @@ var require_tool_cache = __commonJS({ let succeeded = false; try { yield pipeline(readStream, fs20.createWriteStream(dest)); - core17.debug("download complete"); + core18.debug("download complete"); succeeded = true; return dest; } finally { if (!succeeded) { - core17.debug("download failed"); + core18.debug("download failed"); try { yield io7.rmRF(dest); } catch (err) { - core17.debug(`Failed to delete '${dest}'. ${err.message}`); + core18.debug(`Failed to delete '${dest}'. ${err.message}`); } } } @@ -99403,7 +99296,7 @@ var require_tool_cache = __commonJS({ process.chdir(dest); if (_7zPath) { try { - const logLevel = core17.isDebug() ? "-bb1" : "-bb0"; + const logLevel = core18.isDebug() ? "-bb1" : "-bb0"; const args = [ "x", // eXtract files with full paths @@ -99423,7 +99316,7 @@ var require_tool_cache = __commonJS({ process.chdir(originalCwd); } } else { - const escapedScript = path18.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); + const escapedScript = path19.join(__dirname, "..", "scripts", "Invoke-7zdec.ps1").replace(/'/g, "''").replace(/"|\n|\r/g, ""); const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ""); const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ""); const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`; @@ -99456,7 +99349,7 @@ var require_tool_cache = __commonJS({ throw new Error("parameter 'file' is required"); } dest = yield _createExtractFolder(dest); - core17.debug("Checking tar --version"); + core18.debug("Checking tar --version"); let versionOutput = ""; yield (0, exec_1.exec)("tar --version", [], { ignoreReturnCode: true, @@ -99466,7 +99359,7 @@ var require_tool_cache = __commonJS({ stderr: (data) => versionOutput += data.toString() } }); - core17.debug(versionOutput.trim()); + core18.debug(versionOutput.trim()); const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); let args; if (flags instanceof Array) { @@ -99474,7 +99367,7 @@ var require_tool_cache = __commonJS({ } else { args = [flags]; } - if (core17.isDebug() && !flags.includes("v")) { + if (core18.isDebug() && !flags.includes("v")) { args.push("-v"); } let destArg = dest; @@ -99505,7 +99398,7 @@ var require_tool_cache = __commonJS({ args = [flags]; } args.push("-x", "-C", dest, "-f", file); - if (core17.isDebug()) { + if (core18.isDebug()) { args.push("-v"); } const xarPath = yield io7.which("xar", true); @@ -99548,7 +99441,7 @@ var require_tool_cache = __commonJS({ "-Command", pwshCommand ]; - core17.debug(`Using pwsh at path: ${pwshPath}`); + core18.debug(`Using pwsh at path: ${pwshPath}`); yield (0, exec_1.exec)(`"${pwshPath}"`, args); } else { const powershellCommand = [ @@ -99568,7 +99461,7 @@ var require_tool_cache = __commonJS({ powershellCommand ]; const powershellPath = yield io7.which("powershell", true); - core17.debug(`Using powershell at path: ${powershellPath}`); + core18.debug(`Using powershell at path: ${powershellPath}`); yield (0, exec_1.exec)(`"${powershellPath}"`, args); } }); @@ -99577,7 +99470,7 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const unzipPath = yield io7.which("unzip", true); const args = [file]; - if (!core17.isDebug()) { + if (!core18.isDebug()) { args.unshift("-q"); } args.unshift("-o"); @@ -99588,14 +99481,14 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os4.arch(); - core17.debug(`Caching tool ${tool} ${version} ${arch2}`); - core17.debug(`source dir: ${sourceDir}`); + core18.debug(`Caching tool ${tool} ${version} ${arch2}`); + core18.debug(`source dir: ${sourceDir}`); if (!fs20.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } const destPath = yield _createToolPath(tool, version, arch2); for (const itemName of fs20.readdirSync(sourceDir)) { - const s = path18.join(sourceDir, itemName); + const s = path19.join(sourceDir, itemName); yield io7.cp(s, destPath, { recursive: true }); } _completeToolPath(tool, version, arch2); @@ -99606,14 +99499,14 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os4.arch(); - core17.debug(`Caching tool ${tool} ${version} ${arch2}`); - core17.debug(`source file: ${sourceFile}`); + core18.debug(`Caching tool ${tool} ${version} ${arch2}`); + core18.debug(`source file: ${sourceFile}`); if (!fs20.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path18.join(destFolder, targetFile); - core17.debug(`destination file ${destPath}`); + const destPath = path19.join(destFolder, targetFile); + core18.debug(`destination file ${destPath}`); yield io7.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); return destFolder; @@ -99635,13 +99528,13 @@ var require_tool_cache = __commonJS({ let toolPath = ""; if (versionSpec) { versionSpec = semver9.clean(versionSpec) || ""; - const cachePath = path18.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core17.debug(`checking cache: ${cachePath}`); + const cachePath = path19.join(_getCacheDirectory(), toolName, versionSpec, arch2); + core18.debug(`checking cache: ${cachePath}`); if (fs20.existsSync(cachePath) && fs20.existsSync(`${cachePath}.complete`)) { - core17.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + core18.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { - core17.debug("not found"); + core18.debug("not found"); } } return toolPath; @@ -99649,12 +99542,12 @@ var require_tool_cache = __commonJS({ function findAllVersions2(toolName, arch2) { const versions = []; arch2 = arch2 || os4.arch(); - const toolPath = path18.join(_getCacheDirectory(), toolName); + const toolPath = path19.join(_getCacheDirectory(), toolName); if (fs20.existsSync(toolPath)) { const children = fs20.readdirSync(toolPath); for (const child of children) { if (isExplicitVersion(child)) { - const fullPath = path18.join(toolPath, child, arch2 || ""); + const fullPath = path19.join(toolPath, child, arch2 || ""); if (fs20.existsSync(fullPath) && fs20.existsSync(`${fullPath}.complete`)) { versions.push(child); } @@ -99670,7 +99563,7 @@ var require_tool_cache = __commonJS({ const http = new httpm.HttpClient("tool-cache"); const headers = {}; if (auth2) { - core17.debug("set auth"); + core18.debug("set auth"); headers.authorization = auth2; } const response = yield http.getJson(treeUrl, headers); @@ -99691,7 +99584,7 @@ var require_tool_cache = __commonJS({ try { releases = JSON.parse(versionsRaw); } catch (_a) { - core17.debug("Invalid json"); + core18.debug("Invalid json"); } } return releases; @@ -99706,7 +99599,7 @@ var require_tool_cache = __commonJS({ function _createExtractFolder(dest) { return __awaiter2(this, void 0, void 0, function* () { if (!dest) { - dest = path18.join(_getTempDirectory(), crypto2.randomUUID()); + dest = path19.join(_getTempDirectory(), crypto2.randomUUID()); } yield io7.mkdirP(dest); return dest; @@ -99714,8 +99607,8 @@ var require_tool_cache = __commonJS({ } function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { - const folderPath = path18.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); - core17.debug(`destination ${folderPath}`); + const folderPath = path19.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + core18.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io7.rmRF(folderPath); yield io7.rmRF(markerPath); @@ -99724,21 +99617,21 @@ var require_tool_cache = __commonJS({ }); } function _completeToolPath(tool, version, arch2) { - const folderPath = path18.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const folderPath = path19.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; fs20.writeFileSync(markerPath, ""); - core17.debug("finished caching tool"); + core18.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { const c = semver9.clean(versionSpec) || ""; - core17.debug(`isExplicit: ${c}`); + core18.debug(`isExplicit: ${c}`); const valid3 = semver9.valid(c) != null; - core17.debug(`explicit? ${valid3}`); + core18.debug(`explicit? ${valid3}`); return valid3; } function evaluateVersions(versions, versionSpec) { let version = ""; - core17.debug(`evaluating ${versions.length} versions`); + core18.debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver9.gt(a, b)) { return 1; @@ -99754,9 +99647,9 @@ var require_tool_cache = __commonJS({ } } if (version) { - core17.debug(`matched: ${version}`); + core18.debug(`matched: ${version}`); } else { - core17.debug("match not found"); + core18.debug("match not found"); } return version; } @@ -99940,7 +99833,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -100195,7 +100088,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -100211,7 +100104,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -100238,7 +100131,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url2.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -100310,11 +100203,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -102438,14 +102331,14 @@ var require_retention = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getExpiration = void 0; var generated_1 = require_generated(); - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); function getExpiration(retentionDays) { if (!retentionDays) { return void 0; } const maxRetentionDays = getRetentionDays(); if (maxRetentionDays && maxRetentionDays < retentionDays) { - core17.warning(`Retention days cannot be greater than the maximum allowed retention set within the repository. Using ${maxRetentionDays} instead.`); + core18.warning(`Retention days cannot be greater than the maximum allowed retention set within the repository. Using ${maxRetentionDays} instead.`); retentionDays = maxRetentionDays; } const expirationDate = /* @__PURE__ */ new Date(); @@ -102506,13 +102399,13 @@ These characters are not allowed in the artifact name due to limitations with ce (0, core_1.info)(`Artifact name is valid!`); } exports2.validateArtifactName = validateArtifactName; - function validateFilePath(path18) { - if (!path18) { + function validateFilePath(path19) { + if (!path19) { throw new Error(`Provided file path input during validation is empty`); } for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path18.includes(invalidCharacterKey)) { - throw new Error(`The path for one of the files in artifact is not valid: ${path18}. Contains the following character: ${errorMessageForCharacter} + if (path19.includes(invalidCharacterKey)) { + throw new Error(`The path for one of the files in artifact is not valid: ${path19}. Contains the following character: ${errorMessageForCharacter} Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} @@ -102526,7 +102419,7 @@ The following characters are not allowed in files that are uploaded due to limit }); // node_modules/@actions/artifact/package.json -var require_package3 = __commonJS({ +var require_package2 = __commonJS({ "node_modules/@actions/artifact/package.json"(exports2, module2) { module2.exports = { name: "@actions/artifact", @@ -102605,7 +102498,7 @@ var require_user_agent2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = void 0; - var packageJson = require_package3(); + var packageJson = require_package2(); function getUserAgentString() { return `@actions/artifact-${packageJson.version}`; } @@ -102783,7 +102676,7 @@ var require_util19 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.maskSecretUrls = exports2.maskSigUrl = exports2.getBackendIdsFromToken = void 0; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var config_1 = require_config2(); var jwt_decode_1 = __importDefault2(require_jwt_decode_cjs()); var core_1 = require_core(); @@ -102810,8 +102703,8 @@ var require_util19 = __commonJS({ workflowRunBackendId: scopeParts[1], workflowJobRunBackendId: scopeParts[2] }; - core17.debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`); - core17.debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`); + core18.debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`); + core18.debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`); return ids; } throw InvalidJwtError; @@ -103171,7 +103064,7 @@ var require_blob_upload = __commonJS({ exports2.uploadZipToBlobStorage = void 0; var storage_blob_1 = require_commonjs15(); var config_1 = require_config2(); - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var crypto2 = __importStar2(require("crypto")); var stream2 = __importStar2(require("stream")); var errors_1 = require_errors4(); @@ -103197,9 +103090,9 @@ var require_blob_upload = __commonJS({ const bufferSize = (0, config_1.getUploadChunkSize)(); const blobClient = new storage_blob_1.BlobClient(authenticatedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); - core17.debug(`Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}`); + core18.debug(`Uploading artifact zip to blob storage with maxConcurrency: ${maxConcurrency}, bufferSize: ${bufferSize}`); const uploadCallback = (progress) => { - core17.info(`Uploaded bytes ${progress.loadedBytes}`); + core18.info(`Uploaded bytes ${progress.loadedBytes}`); uploadByteCount = progress.loadedBytes; lastProgressTime = Date.now(); }; @@ -103213,7 +103106,7 @@ var require_blob_upload = __commonJS({ const hashStream = crypto2.createHash("sha256"); zipUploadStream.pipe(uploadStream); zipUploadStream.pipe(hashStream).setEncoding("hex"); - core17.info("Beginning upload of artifact content to blob storage"); + core18.info("Beginning upload of artifact content to blob storage"); try { yield Promise.race([ blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options), @@ -103227,12 +103120,12 @@ var require_blob_upload = __commonJS({ } finally { abortController.abort(); } - core17.info("Finished uploading artifact content to blob storage!"); + core18.info("Finished uploading artifact content to blob storage!"); hashStream.end(); sha256Hash = hashStream.read(); - core17.info(`SHA256 digest of uploaded artifact zip is ${sha256Hash}`); + core18.info(`SHA256 digest of uploaded artifact zip is ${sha256Hash}`); if (uploadByteCount === 0) { - core17.warning(`No data was uploaded to blob storage. Reported upload byte count is 0.`); + core18.warning(`No data was uploaded to blob storage. Reported upload byte count is 0.`); } return { uploadSize: uploadByteCount, @@ -103413,8 +103306,8 @@ var require_minimatch2 = __commonJS({ return new Minimatch(pattern, options).match(p); }; module2.exports = minimatch; - var path18 = require_path(); - minimatch.sep = path18.sep; + var path19 = require_path(); + minimatch.sep = path19.sep; var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); minimatch.GLOBSTAR = GLOBSTAR; var expand2 = require_brace_expansion2(); @@ -104020,8 +103913,8 @@ var require_minimatch2 = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; const options = this.options; - if (path18.sep !== "/") { - f = f.split(path18.sep).join("/"); + if (path19.sep !== "/") { + f = f.split(path19.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -104119,8 +104012,8 @@ var require_readdir_glob = __commonJS({ }); }); } - async function* exploreWalkAsync(dir, path18, followSymlinks, useStat, shouldSkip, strict) { - let files = await readdir(path18 + dir, strict); + async function* exploreWalkAsync(dir, path19, followSymlinks, useStat, shouldSkip, strict) { + let files = await readdir(path19 + dir, strict); for (const file of files) { let name = file.name; if (name === void 0) { @@ -104129,7 +104022,7 @@ var require_readdir_glob = __commonJS({ } const filename = dir + "/" + name; const relative2 = filename.slice(1); - const absolute = path18 + "/" + relative2; + const absolute = path19 + "/" + relative2; let stats = null; if (useStat || followSymlinks) { stats = await stat(absolute, followSymlinks); @@ -104143,15 +104036,15 @@ var require_readdir_glob = __commonJS({ if (stats.isDirectory()) { if (!shouldSkip(relative2)) { yield { relative: relative2, absolute, stats }; - yield* exploreWalkAsync(filename, path18, followSymlinks, useStat, shouldSkip, false); + yield* exploreWalkAsync(filename, path19, followSymlinks, useStat, shouldSkip, false); } } else { yield { relative: relative2, absolute, stats }; } } } - async function* explore(path18, followSymlinks, useStat, shouldSkip) { - yield* exploreWalkAsync("", path18, followSymlinks, useStat, shouldSkip, true); + async function* explore(path19, followSymlinks, useStat, shouldSkip) { + yield* exploreWalkAsync("", path19, followSymlinks, useStat, shouldSkip, true); } function readOptions(options) { return { @@ -104689,8 +104582,8 @@ var require_async = __commonJS({ return callback(null, results); } while (readyTasks.length && runningTasks < concurrency) { - var run3 = readyTasks.shift(); - run3(); + var run2 = readyTasks.shift(); + run2(); } } function addListener(taskName, fn) { @@ -106189,14 +106082,14 @@ var require_polyfills = __commonJS({ fs20.fstatSync = statFixSync(fs20.fstatSync); fs20.lstatSync = statFixSync(fs20.lstatSync); if (fs20.chmod && !fs20.lchmod) { - fs20.lchmod = function(path18, mode, cb) { + fs20.lchmod = function(path19, mode, cb) { if (cb) process.nextTick(cb); }; fs20.lchmodSync = function() { }; } if (fs20.chown && !fs20.lchown) { - fs20.lchown = function(path18, uid, gid, cb) { + fs20.lchown = function(path19, uid, gid, cb) { if (cb) process.nextTick(cb); }; fs20.lchownSync = function() { @@ -106263,9 +106156,9 @@ var require_polyfills = __commonJS({ }; })(fs20.readSync); function patchLchmod(fs21) { - fs21.lchmod = function(path18, mode, callback) { + fs21.lchmod = function(path19, mode, callback) { fs21.open( - path18, + path19, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) { @@ -106281,8 +106174,8 @@ var require_polyfills = __commonJS({ } ); }; - fs21.lchmodSync = function(path18, mode) { - var fd = fs21.openSync(path18, constants.O_WRONLY | constants.O_SYMLINK, mode); + fs21.lchmodSync = function(path19, mode) { + var fd = fs21.openSync(path19, constants.O_WRONLY | constants.O_SYMLINK, mode); var threw = true; var ret; try { @@ -106303,8 +106196,8 @@ var require_polyfills = __commonJS({ } function patchLutimes(fs21) { if (constants.hasOwnProperty("O_SYMLINK") && fs21.futimes) { - fs21.lutimes = function(path18, at, mt, cb) { - fs21.open(path18, constants.O_SYMLINK, function(er, fd) { + fs21.lutimes = function(path19, at, mt, cb) { + fs21.open(path19, constants.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); return; @@ -106316,8 +106209,8 @@ var require_polyfills = __commonJS({ }); }); }; - fs21.lutimesSync = function(path18, at, mt) { - var fd = fs21.openSync(path18, constants.O_SYMLINK); + fs21.lutimesSync = function(path19, at, mt) { + var fd = fs21.openSync(path19, constants.O_SYMLINK); var ret; var threw = true; try { @@ -106435,11 +106328,11 @@ var require_legacy_streams = __commonJS({ ReadStream, WriteStream }; - function ReadStream(path18, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path18, options); + function ReadStream(path19, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path19, options); Stream.call(this); var self2 = this; - this.path = path18; + this.path = path19; this.fd = null; this.readable = true; this.paused = false; @@ -106484,10 +106377,10 @@ var require_legacy_streams = __commonJS({ self2._read(); }); } - function WriteStream(path18, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path18, options); + function WriteStream(path19, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path19, options); Stream.call(this); - this.path = path18; + this.path = path19; this.fd = null; this.writable = true; this.flags = "w"; @@ -106563,8 +106456,8 @@ var require_graceful_fs = __commonJS({ } function noop3() { } - function publishQueue(context3, queue2) { - Object.defineProperty(context3, gracefulQueue, { + function publishQueue(context4, queue2) { + Object.defineProperty(context4, gracefulQueue, { get: function() { return queue2; } @@ -106630,14 +106523,14 @@ var require_graceful_fs = __commonJS({ fs21.createWriteStream = createWriteStream3; var fs$readFile = fs21.readFile; fs21.readFile = readFile; - function readFile(path18, options, cb) { + function readFile(path19, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$readFile(path18, options, cb); - function go$readFile(path19, options2, cb2, startTime) { - return fs$readFile(path19, options2, function(err) { + return go$readFile(path19, options, cb); + function go$readFile(path20, options2, cb2, startTime) { + return fs$readFile(path20, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path19, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$readFile, [path20, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106647,14 +106540,14 @@ var require_graceful_fs = __commonJS({ } var fs$writeFile = fs21.writeFile; fs21.writeFile = writeFile; - function writeFile(path18, data, options, cb) { + function writeFile(path19, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$writeFile(path18, data, options, cb); - function go$writeFile(path19, data2, options2, cb2, startTime) { - return fs$writeFile(path19, data2, options2, function(err) { + return go$writeFile(path19, data, options, cb); + function go$writeFile(path20, data2, options2, cb2, startTime) { + return fs$writeFile(path20, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path19, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$writeFile, [path20, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106665,14 +106558,14 @@ var require_graceful_fs = __commonJS({ var fs$appendFile = fs21.appendFile; if (fs$appendFile) fs21.appendFile = appendFile; - function appendFile(path18, data, options, cb) { + function appendFile(path19, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$appendFile(path18, data, options, cb); - function go$appendFile(path19, data2, options2, cb2, startTime) { - return fs$appendFile(path19, data2, options2, function(err) { + return go$appendFile(path19, data, options, cb); + function go$appendFile(path20, data2, options2, cb2, startTime) { + return fs$appendFile(path20, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path19, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$appendFile, [path20, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -106703,31 +106596,31 @@ var require_graceful_fs = __commonJS({ var fs$readdir = fs21.readdir; fs21.readdir = readdir; var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path18, options, cb) { + function readdir(path19, options, cb) { if (typeof options === "function") cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path19, options2, cb2, startTime) { - return fs$readdir(path19, fs$readdirCallback( - path19, + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path20, options2, cb2, startTime) { + return fs$readdir(path20, fs$readdirCallback( + path20, options2, cb2, startTime )); - } : function go$readdir2(path19, options2, cb2, startTime) { - return fs$readdir(path19, options2, fs$readdirCallback( - path19, + } : function go$readdir2(path20, options2, cb2, startTime) { + return fs$readdir(path20, options2, fs$readdirCallback( + path20, options2, cb2, startTime )); }; - return go$readdir(path18, options, cb); - function fs$readdirCallback(path19, options2, cb2, startTime) { + return go$readdir(path19, options, cb); + function fs$readdirCallback(path20, options2, cb2, startTime) { return function(err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readdir, - [path19, options2, cb2], + [path20, options2, cb2], err, startTime || Date.now(), Date.now() @@ -106798,7 +106691,7 @@ var require_graceful_fs = __commonJS({ enumerable: true, configurable: true }); - function ReadStream(path18, options) { + function ReadStream(path19, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else @@ -106818,7 +106711,7 @@ var require_graceful_fs = __commonJS({ } }); } - function WriteStream(path18, options) { + function WriteStream(path19, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else @@ -106836,22 +106729,22 @@ var require_graceful_fs = __commonJS({ } }); } - function createReadStream2(path18, options) { - return new fs21.ReadStream(path18, options); + function createReadStream2(path19, options) { + return new fs21.ReadStream(path19, options); } - function createWriteStream3(path18, options) { - return new fs21.WriteStream(path18, options); + function createWriteStream3(path19, options) { + return new fs21.WriteStream(path19, options); } var fs$open = fs21.open; fs21.open = open; - function open(path18, flags, mode, cb) { + function open(path19, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; - return go$open(path18, flags, mode, cb); - function go$open(path19, flags2, mode2, cb2, startTime) { - return fs$open(path19, flags2, mode2, function(err, fd) { + return go$open(path19, flags, mode, cb); + function go$open(path20, flags2, mode2, cb2, startTime) { + return fs$open(path20, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path19, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$open, [path20, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -107072,10 +106965,10 @@ var require_util20 = __commonJS({ return typeof arg === "number"; } exports2.isNumber = isNumber; - function isString(arg) { + function isString2(arg) { return typeof arg === "string"; } - exports2.isString = isString; + exports2.isString = isString2; function isSymbol(arg) { return typeof arg === "symbol"; } @@ -107088,10 +106981,10 @@ var require_util20 = __commonJS({ return objectToString(re) === "[object RegExp]"; } exports2.isRegExp = isRegExp; - function isObject2(arg) { + function isObject3(arg) { return typeof arg === "object" && arg !== null; } - exports2.isObject = isObject2; + exports2.isObject = isObject3; function isDate(d) { return objectToString(d) === "[object Date]"; } @@ -108952,22 +108845,22 @@ var require_lazystream = __commonJS({ // node_modules/normalize-path/index.js var require_normalize_path = __commonJS({ "node_modules/normalize-path/index.js"(exports2, module2) { - module2.exports = function(path18, stripTrailing) { - if (typeof path18 !== "string") { + module2.exports = function(path19, stripTrailing) { + if (typeof path19 !== "string") { throw new TypeError("expected path to be a string"); } - if (path18 === "\\" || path18 === "/") return "/"; - var len = path18.length; - if (len <= 1) return path18; + if (path19 === "\\" || path19 === "/") return "/"; + var len = path19.length; + if (len <= 1) return path19; var prefix = ""; - if (len > 4 && path18[3] === "\\") { - var ch = path18[2]; - if ((ch === "?" || ch === ".") && path18.slice(0, 2) === "\\\\") { - path18 = path18.slice(2); + if (len > 4 && path19[3] === "\\") { + var ch = path19[2]; + if ((ch === "?" || ch === ".") && path19.slice(0, 2) === "\\\\") { + path19 = path19.slice(2); prefix = "//"; } } - var segs = path18.split(/[/\\]+/); + var segs = path19.split(/[/\\]+/); if (stripTrailing !== false && segs[segs.length - 1] === "") { segs.pop(); } @@ -109133,11 +109026,11 @@ var require_baseGetTag = __commonJS({ // node_modules/lodash/isObject.js var require_isObject = __commonJS({ "node_modules/lodash/isObject.js"(exports2, module2) { - function isObject2(value) { + function isObject3(value) { var type2 = typeof value; return value != null && (type2 == "object" || type2 == "function"); } - module2.exports = isObject2; + module2.exports = isObject3; } }); @@ -109145,13 +109038,13 @@ var require_isObject = __commonJS({ var require_isFunction = __commonJS({ "node_modules/lodash/isFunction.js"(exports2, module2) { var baseGetTag = require_baseGetTag(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var asyncTag = "[object AsyncFunction]"; var funcTag = "[object Function]"; var genTag = "[object GeneratorFunction]"; var proxyTag = "[object Proxy]"; function isFunction(value) { - if (!isObject2(value)) { + if (!isObject3(value)) { return false; } var tag = baseGetTag(value); @@ -109212,7 +109105,7 @@ var require_baseIsNative = __commonJS({ "node_modules/lodash/_baseIsNative.js"(exports2, module2) { var isFunction = require_isFunction(); var isMasked = require_isMasked(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var toSource = require_toSource(); var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; @@ -109224,7 +109117,7 @@ var require_baseIsNative = __commonJS({ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function baseIsNative(value) { - if (!isObject2(value) || isMasked(value)) { + if (!isObject3(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; @@ -109392,9 +109285,9 @@ var require_isIterateeCall = __commonJS({ var eq = require_eq2(); var isArrayLike = require_isArrayLike(); var isIndex = require_isIndex(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); function isIterateeCall(value, index, object) { - if (!isObject2(object)) { + if (!isObject3(object)) { return false; } var type2 = typeof index; @@ -109639,13 +109532,13 @@ var require_nativeKeysIn = __commonJS({ // node_modules/lodash/_baseKeysIn.js var require_baseKeysIn = __commonJS({ "node_modules/lodash/_baseKeysIn.js"(exports2, module2) { - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var isPrototype = require_isPrototype(); var nativeKeysIn = require_nativeKeysIn(); var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function baseKeysIn(object) { - if (!isObject2(object)) { + if (!isObject3(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; @@ -110137,7 +110030,7 @@ var require_event_target_shim = __commonJS({ var CAPTURE = 1; var BUBBLE = 2; var ATTRIBUTE = 3; - function isObject2(x) { + function isObject3(x) { return x !== null && typeof x === "object"; } function getListeners(eventTarget) { @@ -110163,7 +110056,7 @@ var require_event_target_shim = __commonJS({ return null; }, set(listener) { - if (typeof listener !== "function" && !isObject2(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { listener = null; } const listeners = getListeners(this); @@ -110254,11 +110147,11 @@ var require_event_target_shim = __commonJS({ if (listener == null) { return; } - if (typeof listener !== "function" && !isObject2(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { throw new TypeError("'listener' should be a function or an object."); } const listeners = getListeners(this); - const optionsIsObj = isObject2(options); + const optionsIsObj = isObject3(options); const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; const newNode = { @@ -110295,7 +110188,7 @@ var require_event_target_shim = __commonJS({ return; } const listeners = getListeners(this); - const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options); + const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; let prev = null; let node = listeners.get(eventName); @@ -117757,11 +117650,11 @@ var require_commonjs20 = __commonJS({ return (f) => f.length === len && f !== "." && f !== ".."; }; var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix"; - var path18 = { + var path19 = { win32: { sep: "\\" }, posix: { sep: "/" } }; - exports2.sep = defaultPlatform === "win32" ? path18.win32.sep : path18.posix.sep; + exports2.sep = defaultPlatform === "win32" ? path19.win32.sep : path19.posix.sep; exports2.minimatch.sep = exports2.sep; exports2.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); exports2.minimatch.GLOBSTAR = exports2.GLOBSTAR; @@ -118730,7 +118623,7 @@ var require_commonjs21 = __commonJS({ free: c.#free, // methods isBackgroundFetch: (p) => c.#isBackgroundFetch(p), - backgroundFetch: (k, index, options, context3) => c.#backgroundFetch(k, index, options, context3), + backgroundFetch: (k, index, options, context4) => c.#backgroundFetch(k, index, options, context4), moveToTail: (index) => c.#moveToTail(index), indexes: (options) => c.#indexes(options), rindexes: (options) => c.#rindexes(options), @@ -119533,7 +119426,7 @@ var require_commonjs21 = __commonJS({ const v = this.#valList[index]; return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v; } - #backgroundFetch(k, index, options, context3) { + #backgroundFetch(k, index, options, context4) { const v = index === void 0 ? void 0 : this.#valList[index]; if (this.#isBackgroundFetch(v)) { return v; @@ -119546,7 +119439,7 @@ var require_commonjs21 = __commonJS({ const fetchOpts = { signal: ac.signal, options, - context: context3 + context: context4 }; const cb = (v2, updateCache = false) => { const { aborted } = ac.signal; @@ -119663,7 +119556,7 @@ var require_commonjs21 = __commonJS({ allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, - context: context3, + context: context4, forceRefresh = false, status, signal @@ -119698,7 +119591,7 @@ var require_commonjs21 = __commonJS({ if (index === void 0) { if (status) status.fetch = "miss"; - const p = this.#backgroundFetch(k, index, options, context3); + const p = this.#backgroundFetch(k, index, options, context4); return p.__returned = p; } else { const v = this.#valList[index]; @@ -119723,7 +119616,7 @@ var require_commonjs21 = __commonJS({ this.#statusTTL(status, index); return v; } - const p = this.#backgroundFetch(k, index, options, context3); + const p = this.#backgroundFetch(k, index, options, context4); const hasStale = p.__staleWhileFetching !== void 0; const staleVal = hasStale && allowStale; if (status) { @@ -119745,13 +119638,13 @@ var require_commonjs21 = __commonJS({ if (!memoMethod) { throw new Error("no memoMethod provided to constructor"); } - const { context: context3, forceRefresh, ...options } = memoOptions; + const { context: context4, forceRefresh, ...options } = memoOptions; const v = this.get(k, options); if (!forceRefresh && v !== void 0) return v; const vv = memoMethod(k, v, { options, - context: context3 + context: context4 }); this.set(k, vv, options); return vv; @@ -121120,12 +121013,12 @@ var require_commonjs23 = __commonJS({ /** * Get the Path object referenced by the string path, resolved from this Path */ - resolve(path18) { - if (!path18) { + resolve(path19) { + if (!path19) { return this; } - const rootPath = this.getRootString(path18); - const dir = path18.substring(rootPath.length); + const rootPath = this.getRootString(path19); + const dir = path19.substring(rootPath.length); const dirParts = dir.split(this.splitSep); const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts); return result; @@ -121878,8 +121771,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - getRootString(path18) { - return node_path_1.win32.parse(path18).root; + getRootString(path19) { + return node_path_1.win32.parse(path19).root; } /** * @internal @@ -121926,8 +121819,8 @@ var require_commonjs23 = __commonJS({ /** * @internal */ - getRootString(path18) { - return path18.startsWith("/") ? "/" : ""; + getRootString(path19) { + return path19.startsWith("/") ? "/" : ""; } /** * @internal @@ -122017,11 +121910,11 @@ var require_commonjs23 = __commonJS({ /** * Get the depth of a provided path, string, or the cwd */ - depth(path18 = this.cwd) { - if (typeof path18 === "string") { - path18 = this.cwd.resolve(path18); + depth(path19 = this.cwd) { + if (typeof path19 === "string") { + path19 = this.cwd.resolve(path19); } - return path18.depth(); + return path19.depth(); } /** * Return the cache of child entries. Exposed so subclasses can create @@ -122508,9 +122401,9 @@ var require_commonjs23 = __commonJS({ process2(); return results; } - chdir(path18 = this.cwd) { + chdir(path19 = this.cwd) { const oldCwd = this.cwd; - this.cwd = typeof path18 === "string" ? this.cwd.resolve(path18) : path18; + this.cwd = typeof path19 === "string" ? this.cwd.resolve(path19) : path19; this.cwd[setAsCwd](oldCwd); } }; @@ -122898,8 +122791,8 @@ var require_processor = __commonJS({ } // match, absolute, ifdir entries() { - return [...this.store.entries()].map(([path18, n]) => [ - path18, + return [...this.store.entries()].map(([path19, n]) => [ + path19, !!(n & 2), !!(n & 1) ]); @@ -123117,9 +123010,9 @@ var require_walker = __commonJS({ signal; maxDepth; includeChildMatches; - constructor(patterns, path18, opts) { + constructor(patterns, path19, opts) { this.patterns = patterns; - this.path = path18; + this.path = path19; this.opts = opts; this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/"; this.includeChildMatches = opts.includeChildMatches !== false; @@ -123138,11 +123031,11 @@ var require_walker = __commonJS({ }); } } - #ignored(path18) { - return this.seen.has(path18) || !!this.#ignore?.ignored?.(path18); + #ignored(path19) { + return this.seen.has(path19) || !!this.#ignore?.ignored?.(path19); } - #childrenIgnored(path18) { - return !!this.#ignore?.childrenIgnored?.(path18); + #childrenIgnored(path19) { + return !!this.#ignore?.childrenIgnored?.(path19); } // backpressure mechanism pause() { @@ -123358,8 +123251,8 @@ var require_walker = __commonJS({ exports2.GlobUtil = GlobUtil; var GlobWalker = class extends GlobUtil { matches = /* @__PURE__ */ new Set(); - constructor(patterns, path18, opts) { - super(patterns, path18, opts); + constructor(patterns, path19, opts) { + super(patterns, path19, opts); } matchEmit(e) { this.matches.add(e); @@ -123397,8 +123290,8 @@ var require_walker = __commonJS({ exports2.GlobWalker = GlobWalker; var GlobStream = class extends GlobUtil { results; - constructor(patterns, path18, opts) { - super(patterns, path18, opts); + constructor(patterns, path19, opts) { + super(patterns, path19, opts); this.results = new minipass_1.Minipass({ signal: this.signal, objectMode: true @@ -123754,7 +123647,7 @@ var require_commonjs24 = __commonJS({ var require_file4 = __commonJS({ "node_modules/archiver-utils/file.js"(exports2, module2) { var fs20 = require_graceful_fs(); - var path18 = require("path"); + var path19 = require("path"); var flatten = require_flatten(); var difference = require_difference(); var union = require_union(); @@ -123779,7 +123672,7 @@ var require_file4 = __commonJS({ return result; }; file.exists = function() { - var filepath = path18.join.apply(path18, arguments); + var filepath = path19.join.apply(path19, arguments); return fs20.existsSync(filepath); }; file.expand = function(...args) { @@ -123793,7 +123686,7 @@ var require_file4 = __commonJS({ }); if (options.filter) { matches = matches.filter(function(filepath) { - filepath = path18.join(options.cwd || "", filepath); + filepath = path19.join(options.cwd || "", filepath); try { if (typeof options.filter === "function") { return options.filter(filepath); @@ -123810,7 +123703,7 @@ var require_file4 = __commonJS({ file.expandMapping = function(patterns, destBase, options) { options = Object.assign({ rename: function(destBase2, destPath) { - return path18.join(destBase2 || "", destPath); + return path19.join(destBase2 || "", destPath); } }, options); var files = []; @@ -123818,14 +123711,14 @@ var require_file4 = __commonJS({ file.expand(options, patterns).forEach(function(src) { var destPath = src; if (options.flatten) { - destPath = path18.basename(destPath); + destPath = path19.basename(destPath); } if (options.ext) { destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); } var dest = options.rename(destBase, destPath, options); if (options.cwd) { - src = path18.join(options.cwd, src); + src = path19.join(options.cwd, src); } dest = dest.replace(pathSeparatorRe, "/"); src = src.replace(pathSeparatorRe, "/"); @@ -123907,7 +123800,7 @@ var require_file4 = __commonJS({ var require_archiver_utils = __commonJS({ "node_modules/archiver-utils/index.js"(exports2, module2) { var fs20 = require_graceful_fs(); - var path18 = require("path"); + var path19 = require("path"); var isStream = require_is_stream(); var lazystream = require_lazystream(); var normalizePath = require_normalize_path(); @@ -123995,11 +123888,11 @@ var require_archiver_utils = __commonJS({ if (!file) { return callback(null, results); } - filepath = path18.join(dirpath, file); + filepath = path19.join(dirpath, file); fs20.stat(filepath, function(err2, stats) { results.push({ path: filepath, - relative: path18.relative(base, filepath).replace(/\\/g, "/"), + relative: path19.relative(base, filepath).replace(/\\/g, "/"), stats }); if (stats && stats.isDirectory()) { @@ -124061,7 +123954,7 @@ var require_core2 = __commonJS({ var fs20 = require("fs"); var glob2 = require_readdir_glob(); var async = require_async(); - var path18 = require("path"); + var path19 = require("path"); var util = require_archiver_utils(); var inherits = require("util").inherits; var ArchiverError = require_error3(); @@ -124337,9 +124230,9 @@ var require_core2 = __commonJS({ task.source = Buffer.concat([]); } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) { var linkPath = fs20.readlinkSync(task.filepath); - var dirName = path18.dirname(task.filepath); + var dirName = path19.dirname(task.filepath); task.data.type = "symlink"; - task.data.linkname = path18.relative(dirName, path18.resolve(dirName, linkPath)); + task.data.linkname = path19.relative(dirName, path19.resolve(dirName, linkPath)); task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else { @@ -128573,7 +128466,7 @@ var require_zip2 = __commonJS({ var stream2 = __importStar2(require("stream")); var promises_1 = require("fs/promises"); var archiver2 = __importStar2(require_archiver()); - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var config_1 = require_config2(); exports2.DEFAULT_COMPRESSION_LEVEL = 6; var ZipUploadStream = class extends stream2.Transform { @@ -128590,7 +128483,7 @@ var require_zip2 = __commonJS({ exports2.ZipUploadStream = ZipUploadStream; function createZipUploadStream(uploadSpecification_1) { return __awaiter2(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { - core17.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); + core18.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); const zip = archiver2.create("zip", { highWaterMark: (0, config_1.getUploadChunkSize)(), zlib: { level: compressionLevel } @@ -128614,8 +128507,8 @@ var require_zip2 = __commonJS({ } const bufferSize = (0, config_1.getUploadChunkSize)(); const zipUploadStream = new ZipUploadStream(bufferSize); - core17.debug(`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`); - core17.debug(`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`); + core18.debug(`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`); + core18.debug(`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`); zip.pipe(zipUploadStream); zip.finalize(); return zipUploadStream; @@ -128623,24 +128516,24 @@ var require_zip2 = __commonJS({ } exports2.createZipUploadStream = createZipUploadStream; var zipErrorCallback = (error3) => { - core17.error("An error has occurred while creating the zip file for upload"); - core17.info(error3); + core18.error("An error has occurred while creating the zip file for upload"); + core18.info(error3); throw new Error("An error has occurred during zip creation for the artifact"); }; var zipWarningCallback = (error3) => { if (error3.code === "ENOENT") { - core17.warning("ENOENT warning during artifact zip creation. No such file or directory"); - core17.info(error3); + core18.warning("ENOENT warning during artifact zip creation. No such file or directory"); + core18.info(error3); } else { - core17.warning(`A non-blocking warning has occurred during artifact zip creation: ${error3.code}`); - core17.info(error3); + core18.warning(`A non-blocking warning has occurred during artifact zip creation: ${error3.code}`); + core18.info(error3); } }; var zipFinishCallback = () => { - core17.debug("Zip stream for upload has finished."); + core18.debug("Zip stream for upload has finished."); }; var zipEndCallback = () => { - core17.debug("Zip stream for upload has ended."); + core18.debug("Zip stream for upload has ended."); }; } }); @@ -128705,7 +128598,7 @@ var require_upload_artifact = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.uploadArtifact = void 0; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var retention_1 = require_retention(); var path_and_artifact_name_validation_1 = require_path_and_artifact_name_validation(); var artifact_twirp_client_1 = require_artifact_twirp_client2(); @@ -128752,13 +128645,13 @@ var require_upload_artifact = __commonJS({ value: `sha256:${uploadResult.sha256Hash}` }); } - core17.info(`Finalizing artifact upload`); + core18.info(`Finalizing artifact upload`); const finalizeArtifactResp = yield artifactClient.FinalizeArtifact(finalizeArtifactReq); if (!finalizeArtifactResp.ok) { throw new errors_1.InvalidResponseError("FinalizeArtifact: response from backend was not ok"); } const artifactId = BigInt(finalizeArtifactResp.artifactId); - core17.info(`Artifact ${name}.zip successfully finalized. Artifact ID ${artifactId}`); + core18.info(`Artifact ${name}.zip successfully finalized. Artifact ID ${artifactId}`); return { size: uploadResult.uploadSize, digest: uploadResult.sha256Hash, @@ -128789,8 +128682,8 @@ var require_context2 = __commonJS({ if ((0, fs_1.existsSync)(process.env.GITHUB_EVENT_PATH)) { this.payload = JSON.parse((0, fs_1.readFileSync)(process.env.GITHUB_EVENT_PATH, { encoding: "utf8" })); } else { - const path18 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path18} does not exist${os_1.EOL}`); + const path19 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path19} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -129375,14 +129268,14 @@ var require_util24 = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol}//${url2.hostname}:${port}`; - let path18 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path19 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path18 && !path18.startsWith("/")) { - path18 = `/${path18}`; + if (path19 && !path19.startsWith("/")) { + path19 = `/${path19}`; } - url2 = new URL(origin + path18); + url2 = new URL(origin + path19); } return url2; } @@ -130996,20 +130889,20 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) { "use strict"; - module2.exports = function basename2(path18) { - if (typeof path18 !== "string") { + module2.exports = function basename2(path19) { + if (typeof path19 !== "string") { return ""; } - for (var i = path18.length - 1; i >= 0; --i) { - switch (path18.charCodeAt(i)) { + for (var i = path19.length - 1; i >= 0; --i) { + switch (path19.charCodeAt(i)) { case 47: // '/' case 92: - path18 = path18.slice(i + 1); - return path18 === ".." || path18 === "." ? "" : path18; + path19 = path19.slice(i + 1); + return path19 === ".." || path19 === "." ? "" : path19; } } - return path18 === ".." || path18 === "." ? "" : path18; + return path19 === ".." || path19 === "." ? "" : path19; }; } }); @@ -132645,18 +132538,18 @@ var require_webidl3 = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context3) { - const plural = context3.types.length === 1 ? "" : " one of"; - const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context4) { + const plural = context4.types.length === 1 ? "" : " one of"; + const message = `${context4.argument} could not be converted to${plural}: ${context4.types.join(", ")}.`; return webidl.errors.exception({ - header: context3.prefix, + header: context4.prefix, message }); }; - webidl.errors.invalidArgument = function(context3) { + webidl.errors.invalidArgument = function(context4) { return webidl.errors.exception({ - header: context3.prefix, - message: `"${context3.value}" is an invalid ${context3.type}.` + header: context4.prefix, + message: `"${context4.value}" is an invalid ${context4.type}.` }); }; webidl.brandCheck = function(V, I, opts = void 0) { @@ -134039,7 +133932,7 @@ var require_request5 = __commonJS({ } var Request = class _Request { constructor(origin, { - path: path18, + path: path19, method, body, headers, @@ -134053,11 +133946,11 @@ var require_request5 = __commonJS({ throwOnError, expectContinue }, handler2) { - if (typeof path18 !== "string") { + if (typeof path19 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path18[0] !== "/" && !(path18.startsWith("http://") || path18.startsWith("https://")) && method !== "CONNECT") { + } else if (path19[0] !== "/" && !(path19.startsWith("http://") || path19.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path18) !== null) { + } else if (invalidPathRegex.exec(path19) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -134120,7 +134013,7 @@ var require_request5 = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util.buildURL(path18, query) : path18; + this.path = query ? util.buildURL(path19, query) : path19; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -135128,9 +135021,9 @@ var require_RedirectHandler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path18 = search ? `${pathname}${search}` : pathname; + const path19 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path18; + this.opts.path = path19; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -136370,7 +136263,7 @@ var require_client3 = __commonJS({ writeH2(client, client[kHTTP2Session], request2); return; } - const { body, method, path: path18, host, upgrade, headers, blocking, reset } = request2; + const { body, method, path: path19, host, upgrade, headers, blocking, reset } = request2; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); @@ -136420,7 +136313,7 @@ var require_client3 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path18} HTTP/1.1\r + let header = `${method} ${path19} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -136483,7 +136376,7 @@ upgrade: ${upgrade}\r return true; } function writeH2(client, session, request2) { - const { body, method, path: path18, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; + const { body, method, path: path19, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2; let headers; if (typeof reqHeaders === "string") headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; @@ -136526,7 +136419,7 @@ upgrade: ${upgrade}\r }); return true; } - headers[HTTP2_HEADER_PATH] = path18; + headers[HTTP2_HEADER_PATH] = path19; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -137982,15 +137875,15 @@ var require_api_request3 = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (!this.callback) { throw new RequestAbortedError(); } this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context4, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -138017,7 +137910,7 @@ var require_api_request3 = __commonJS({ trailers: this.trailers, opaque, body, - context: context3 + context: context4 }); } } @@ -138137,15 +138030,15 @@ var require_api_stream3 = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (!this.callback) { throw new RequestAbortedError(); } this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context3, callback, responseHeaders } = this; + const { factory, opaque, context: context4, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -138173,7 +138066,7 @@ var require_api_stream3 = __commonJS({ statusCode, headers, opaque, - context: context3 + context: context4 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -138365,17 +138258,17 @@ var require_api_pipeline3 = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { const { ret, res } = this; assert(!res, "pipeline cannot be retried"); if (ret.destroyed) { throw new RequestAbortedError(); } this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context3 } = this; + const { opaque, handler: handler2, context: context4 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -138393,7 +138286,7 @@ var require_api_pipeline3 = __commonJS({ headers, opaque, body: this.res, - context: context3 + context: context4 }); } catch (err) { this.res.on("error", util.nop); @@ -138477,7 +138370,7 @@ var require_api_upgrade3 = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (!this.callback) { throw new RequestAbortedError(); } @@ -138488,7 +138381,7 @@ var require_api_upgrade3 = __commonJS({ throw new SocketError("bad upgrade", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; assert.strictEqual(statusCode, 101); removeSignal(this); this.callback = null; @@ -138497,7 +138390,7 @@ var require_api_upgrade3 = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -138565,18 +138458,18 @@ var require_api_connect3 = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (!this.callback) { throw new RequestAbortedError(); } this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -138588,7 +138481,7 @@ var require_api_connect3 = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -138766,20 +138659,20 @@ var require_mock_utils3 = __commonJS({ } return true; } - function safeUrl(path18) { - if (typeof path18 !== "string") { - return path18; + function safeUrl(path19) { + if (typeof path19 !== "string") { + return path19; } - const pathSegments = path18.split("?"); + const pathSegments = path19.split("?"); if (pathSegments.length !== 2) { - return path18; + return path19; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path18, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path18); + function matchKey(mockDispatch2, { path: path19, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path19); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -138797,7 +138690,7 @@ var require_mock_utils3 = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path18 }) => matchValue(safeUrl(path18), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path19 }) => matchValue(safeUrl(path19), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -138834,9 +138727,9 @@ var require_mock_utils3 = __commonJS({ } } function buildKey(opts) { - const { path: path18, method, body, headers, query } = opts; + const { path: path19, method, body, headers, query } = opts; return { - path: path18, + path: path19, method, body, headers, @@ -139285,10 +139178,10 @@ var require_pending_interceptors_formatter3 = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path18, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path19, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path18, + Path: path19, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -143908,8 +143801,8 @@ var require_util29 = __commonJS({ } } } - function validateCookiePath(path18) { - for (const char of path18) { + function validateCookiePath(path19) { + for (const char of path19) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -145589,11 +145482,11 @@ var require_undici3 = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path18 = opts.path; + let path19 = opts.path; if (!opts.path.startsWith("/")) { - path18 = `/${path18}`; + path19 = `/${path19}`; } - url2 = new URL(util.parseOrigin(url2).origin + path18); + url2 = new URL(util.parseOrigin(url2).origin + path19); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -146707,8 +146600,8 @@ var require_dist_node2 = __commonJS({ function isKeyOperator2(operator) { return operator === ";" || operator === "&" || operator === "?"; } - function getValues2(context3, operator, key, modifier) { - var value = context3[key], result = []; + function getValues2(context4, operator, key, modifier) { + var value = context4[key], result = []; if (isDefined3(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); @@ -146772,7 +146665,7 @@ var require_dist_node2 = __commonJS({ expand: expand2.bind(null, template) }; } - function expand2(template, context3) { + function expand2(template, context4) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, @@ -146786,7 +146679,7 @@ var require_dist_node2 = __commonJS({ } expression.split(/,/g).forEach(function(variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues2(context3, operator, tmp[1], tmp[2] || tmp[3])); + values.push(getValues2(context4, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; @@ -150443,7 +150336,7 @@ var require_traverse = __commonJS({ })(this.value); }; function walk(root, cb, immutable) { - var path18 = []; + var path19 = []; var parents = []; var alive = true; return (function walker(node_) { @@ -150452,11 +150345,11 @@ var require_traverse = __commonJS({ var state = { node, node_, - path: [].concat(path18), + path: [].concat(path19), parent: parents.slice(-1)[0], - key: path18.slice(-1)[0], - isRoot: path18.length === 0, - level: path18.length, + key: path19.slice(-1)[0], + isRoot: path19.length === 0, + level: path19.length, circular: null, update: function(x) { if (!state.isRoot) { @@ -150511,7 +150404,7 @@ var require_traverse = __commonJS({ parents.push(state); var keys = Object.keys(state.node); keys.forEach(function(key, i2) { - path18.push(key); + path19.push(key); if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); var child = walker(state.node[key]); if (immutable && Object.hasOwnProperty.call(state.node, key)) { @@ -150520,7 +150413,7 @@ var require_traverse = __commonJS({ child.isLast = i2 == keys.length - 1; child.isFirst = i2 == 0; if (modifiers.post) modifiers.post.call(state, child); - path18.pop(); + path19.pop(); }); parents.pop(); } @@ -151541,11 +151434,11 @@ var require_unzip_stream = __commonJS({ return requiredLength; case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: var isUtf8 = (this.parsedEntity.flags & 2048) !== 0; - var path18 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); + var path19 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); var extraDataBuffer = chunk.slice(this.parsedEntity.fileNameLength, this.parsedEntity.fileNameLength + this.parsedEntity.extraFieldLength); var extra = this._readExtraFields(extraDataBuffer); if (extra && extra.parsed && extra.parsed.path && !isUtf8) { - path18 = extra.parsed.path; + path19 = extra.parsed.path; } this.parsedEntity.extra = extra.parsed; var isUnix = (this.parsedEntity.versionMadeBy & 65280) >> 8 === 3; @@ -151557,7 +151450,7 @@ var require_unzip_stream = __commonJS({ } if (this.options.debug) { const debugObj = Object.assign({}, this.parsedEntity, { - path: path18, + path: path19, flags: "0x" + this.parsedEntity.flags.toString(16), unixAttrs: unixAttrs && "0" + unixAttrs.toString(8), isSymlink, @@ -151994,7 +151887,7 @@ var require_parser_stream = __commonJS({ // node_modules/mkdirp/index.js var require_mkdirp = __commonJS({ "node_modules/mkdirp/index.js"(exports2, module2) { - var path18 = require("path"); + var path19 = require("path"); var fs20 = require("fs"); var _0777 = parseInt("0777", 8); module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; @@ -152014,7 +151907,7 @@ var require_mkdirp = __commonJS({ var cb = f || /* istanbul ignore next */ function() { }; - p = path18.resolve(p); + p = path19.resolve(p); xfs.mkdir(p, mode, function(er) { if (!er) { made = made || p; @@ -152022,8 +151915,8 @@ var require_mkdirp = __commonJS({ } switch (er.code) { case "ENOENT": - if (path18.dirname(p) === p) return cb(er); - mkdirP(path18.dirname(p), opts, function(er2, made2) { + if (path19.dirname(p) === p) return cb(er); + mkdirP(path19.dirname(p), opts, function(er2, made2) { if (er2) cb(er2, made2); else mkdirP(p, opts, cb, made2); }); @@ -152050,14 +151943,14 @@ var require_mkdirp = __commonJS({ mode = _0777; } if (!made) made = null; - p = path18.resolve(p); + p = path19.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case "ENOENT": - made = sync(path18.dirname(p), opts, made); + made = sync(path19.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir @@ -152083,7 +151976,7 @@ var require_mkdirp = __commonJS({ var require_extract2 = __commonJS({ "node_modules/unzip-stream/lib/extract.js"(exports2, module2) { var fs20 = require("fs"); - var path18 = require("path"); + var path19 = require("path"); var util = require("util"); var mkdirp = require_mkdirp(); var Transform = require("stream").Transform; @@ -152125,8 +152018,8 @@ var require_extract2 = __commonJS({ }; Extract.prototype._processEntry = function(entry) { var self2 = this; - var destPath = path18.join(this.opts.path, entry.path); - var directory = entry.isDirectory ? destPath : path18.dirname(destPath); + var destPath = path19.join(this.opts.path, entry.path); + var directory = entry.isDirectory ? destPath : path19.dirname(destPath); this.unfinishedEntries++; var writeFileFn = function() { var pipedStream = fs20.createWriteStream(destPath); @@ -152238,8 +152131,8 @@ var require_download_artifact = __commonJS({ var promises_1 = __importDefault2(require("fs/promises")); var crypto2 = __importStar2(require("crypto")); var stream2 = __importStar2(require("stream")); - var github3 = __importStar2(require_github2()); - var core17 = __importStar2(require_core()); + var github4 = __importStar2(require_github2()); + var core18 = __importStar2(require_core()); var httpClient = __importStar2(require_lib()); var unzip_stream_1 = __importDefault2(require_unzip()); var user_agent_1 = require_user_agent2(); @@ -152253,10 +152146,10 @@ var require_download_artifact = __commonJS({ parsed.search = ""; return parsed.toString(); }; - function exists(path18) { + function exists(path19) { return __awaiter2(this, void 0, void 0, function* () { try { - yield promises_1.default.access(path18); + yield promises_1.default.access(path19); return true; } catch (error3) { if (error3.code === "ENOENT") { @@ -152275,7 +152168,7 @@ var require_download_artifact = __commonJS({ return yield streamExtractExternal(url2, directory); } catch (error3) { retryCount++; - core17.debug(`Failed to download artifact after ${retryCount} retries due to ${error3.message}. Retrying in 5 seconds...`); + core18.debug(`Failed to download artifact after ${retryCount} retries due to ${error3.message}. Retrying in 5 seconds...`); yield new Promise((resolve8) => setTimeout(resolve8, 5e3)); } } @@ -152305,7 +152198,7 @@ var require_download_artifact = __commonJS({ extractStream.on("data", () => { timer.refresh(); }).on("error", (error3) => { - core17.debug(`response.message: Artifact download failed: ${error3.message}`); + core18.debug(`response.message: Artifact download failed: ${error3.message}`); clearTimeout(timer); reject(error3); }).pipe(unzip_stream_1.default.Extract({ path: directory })).on("close", () => { @@ -152313,7 +152206,7 @@ var require_download_artifact = __commonJS({ if (hashStream) { hashStream.end(); sha256Digest = hashStream.read(); - core17.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); + core18.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); } resolve8({ sha256Digest: `sha256:${sha256Digest}` }); }).on("error", (error3) => { @@ -152326,9 +152219,9 @@ var require_download_artifact = __commonJS({ function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, token, options) { return __awaiter2(this, void 0, void 0, function* () { const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); - const api = github3.getOctokit(token); + const api = github4.getOctokit(token); let digestMismatch = false; - core17.info(`Downloading artifact '${artifactId}' from '${repositoryOwner}/${repositoryName}'`); + core18.info(`Downloading artifact '${artifactId}' from '${repositoryOwner}/${repositoryName}'`); const { headers, status } = yield api.rest.actions.downloadArtifact({ owner: repositoryOwner, repo: repositoryName, @@ -152345,16 +152238,16 @@ var require_download_artifact = __commonJS({ if (!location) { throw new Error(`Unable to redirect to artifact download url`); } - core17.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); + core18.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); try { - core17.info(`Starting download of artifact to: ${downloadPath}`); + core18.info(`Starting download of artifact to: ${downloadPath}`); const extractResponse = yield streamExtract(location, downloadPath); - core17.info(`Artifact download completed successfully.`); + core18.info(`Artifact download completed successfully.`); if (options === null || options === void 0 ? void 0 : options.expectedHash) { if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) { digestMismatch = true; - core17.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core17.debug(`Expected digest: ${options.expectedHash}`); + core18.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core18.debug(`Expected digest: ${options.expectedHash}`); } } } catch (error3) { @@ -152381,7 +152274,7 @@ var require_download_artifact = __commonJS({ Are you trying to download from a different run? Try specifying a github-token with \`actions:read\` scope.`); } if (artifacts.length > 1) { - core17.warning("Multiple artifacts found, defaulting to first."); + core18.warning("Multiple artifacts found, defaulting to first."); } const signedReq = { workflowRunBackendId: artifacts[0].workflowRunBackendId, @@ -152389,16 +152282,16 @@ Are you trying to download from a different run? Try specifying a github-token w name: artifacts[0].name }; const { signedUrl } = yield artifactClient.GetSignedArtifactURL(signedReq); - core17.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); + core18.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); try { - core17.info(`Starting download of artifact to: ${downloadPath}`); + core18.info(`Starting download of artifact to: ${downloadPath}`); const extractResponse = yield streamExtract(signedUrl, downloadPath); - core17.info(`Artifact download completed successfully.`); + core18.info(`Artifact download completed successfully.`); if (options === null || options === void 0 ? void 0 : options.expectedHash) { if ((options === null || options === void 0 ? void 0 : options.expectedHash) !== extractResponse.sha256Digest) { digestMismatch = true; - core17.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core17.debug(`Expected digest: ${options.expectedHash}`); + core18.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core18.debug(`Expected digest: ${options.expectedHash}`); } } } catch (error3) { @@ -152411,10 +152304,10 @@ Are you trying to download from a different run? Try specifying a github-token w function resolveOrCreateDirectory() { return __awaiter2(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { if (!(yield exists(downloadPath))) { - core17.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); + core18.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); yield promises_1.default.mkdir(downloadPath, { recursive: true }); } else { - core17.debug(`Artifact destination folder already exists: ${downloadPath}`); + core18.debug(`Artifact destination folder already exists: ${downloadPath}`); } return downloadPath; }); @@ -152455,7 +152348,7 @@ var require_retry_options = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRetryOptions = void 0; - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var defaultMaxRetryNumber = 5; var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { @@ -152470,7 +152363,7 @@ var require_retry_options = __commonJS({ retryOptions.doNotRetry = exemptStatusCodes; } const requestOptions = Object.assign(Object.assign({}, defaultOptions.request), { retries }); - core17.debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : "octokit default: [400, 401, 403, 404, 422]"})`); + core18.debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : "octokit default: [400, 401, 403, 404, 422]"})`); return [retryOptions, requestOptions]; } exports2.getRetryOptions = getRetryOptions; @@ -152488,12 +152381,12 @@ var require_dist_node11 = __commonJS({ octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); - const path18 = requestOptions.url.replace(options.baseUrl, ""); + const path19 = requestOptions.url.replace(options.baseUrl, ""); return request2(options).then((response) => { - octokit.log.info(`${requestOptions.method} ${path18} - ${response.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path19} - ${response.status} in ${Date.now() - start}ms`); return response; }).catch((error3) => { - octokit.log.info(`${requestOptions.method} ${path18} - ${error3.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path19} - ${error3.status} in ${Date.now() - start}ms`); throw error3; }); }); @@ -152627,7 +152520,7 @@ var require_get_artifact = __commonJS({ exports2.getArtifactInternal = exports2.getArtifactPublic = void 0; var github_1 = require_github2(); var plugin_retry_1 = require_dist_node12(); - var core17 = __importStar2(require_core()); + var core18 = __importStar2(require_core()); var utils_1 = require_utils11(); var retry_options_1 = require_retry_options(); var plugin_request_log_1 = require_dist_node11(); @@ -152647,8 +152540,8 @@ var require_get_artifact = __commonJS({ retry: retryOpts, request: requestOpts }; - const github3 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); - const getArtifactResp = yield github3.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}", { + const github4 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); + const getArtifactResp = yield github4.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts{?name}", { owner: repositoryOwner, repo: repositoryName, run_id: workflowRunId, @@ -152665,7 +152558,7 @@ var require_get_artifact = __commonJS({ let artifact2 = getArtifactResp.data.artifacts[0]; if (getArtifactResp.data.artifacts.length > 1) { artifact2 = getArtifactResp.data.artifacts.sort((a, b) => b.id - a.id)[0]; - core17.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.id})`); + core18.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.id})`); } return { artifact: { @@ -152698,7 +152591,7 @@ var require_get_artifact = __commonJS({ let artifact2 = res.artifacts[0]; if (res.artifacts.length > 1) { artifact2 = res.artifacts.sort((a, b) => Number(b.databaseId) - Number(a.databaseId))[0]; - core17.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.databaseId})`); + core18.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.databaseId})`); } return { artifact: { @@ -152771,9 +152664,9 @@ var require_delete_artifact = __commonJS({ retry: retryOpts, request: requestOpts }; - const github3 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); + const github4 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); const getArtifactResp = yield (0, get_artifact_1.getArtifactPublic)(artifactName, workflowRunId, repositoryOwner, repositoryName, token); - const deleteArtifactResp = yield github3.rest.actions.deleteArtifact({ + const deleteArtifactResp = yield github4.rest.actions.deleteArtifact({ owner: repositoryOwner, repo: repositoryName, artifact_id: getArtifactResp.artifact.id @@ -152880,9 +152773,9 @@ var require_list_artifacts = __commonJS({ retry: retryOpts, request: requestOpts }; - const github3 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); + const github4 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); let currentPageNumber = 1; - const { data: listArtifactResponse } = yield github3.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", { + const { data: listArtifactResponse } = yield github4.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", { owner: repositoryOwner, repo: repositoryName, run_id: workflowRunId, @@ -152907,7 +152800,7 @@ var require_list_artifacts = __commonJS({ currentPageNumber++; for (currentPageNumber; currentPageNumber <= numberOfPages; currentPageNumber++) { (0, core_1.debug)(`Fetching page ${currentPageNumber} of artifact list`); - const { data: listArtifactResponse2 } = yield github3.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", { + const { data: listArtifactResponse2 } = yield github4.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", { owner: repositoryOwner, repo: repositoryName, run_id: workflowRunId, @@ -154588,7 +154481,7 @@ var require_path_utils2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); function toPosixPath(pth) { return pth.replace(/[\\]/g, "/"); } @@ -154598,7 +154491,7 @@ var require_path_utils2 = __commonJS({ } exports2.toWin32Path = toWin32Path; function toPlatformPath(pth) { - return pth.replace(/[/\\]/g, path18.sep); + return pth.replace(/[/\\]/g, path19.sep); } exports2.toPlatformPath = toPlatformPath; } @@ -154662,7 +154555,7 @@ var require_io_util2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getCmdPath = exports2.tryGetExecutablePath = exports2.isRooted = exports2.isDirectory = exports2.exists = exports2.READONLY = exports2.UV_FS_O_EXLOCK = exports2.IS_WINDOWS = exports2.unlink = exports2.symlink = exports2.stat = exports2.rmdir = exports2.rm = exports2.rename = exports2.readlink = exports2.readdir = exports2.open = exports2.mkdir = exports2.lstat = exports2.copyFile = exports2.chmod = void 0; var fs20 = __importStar2(require("fs")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); _a = fs20.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; @@ -154711,7 +154604,7 @@ var require_io_util2 = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path18.extname(filePath).toUpperCase(); + const upperExt = path19.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -154735,11 +154628,11 @@ var require_io_util2 = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path18.dirname(filePath); - const upperName = path18.basename(filePath).toUpperCase(); + const directory = path19.dirname(filePath); + const upperName = path19.basename(filePath).toUpperCase(); for (const actualName of yield exports2.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path18.join(directory, actualName); + filePath = path19.join(directory, actualName); break; } } @@ -154834,7 +154727,7 @@ var require_io2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; var assert_1 = require("assert"); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { return __awaiter2(this, void 0, void 0, function* () { @@ -154843,7 +154736,7 @@ var require_io2 = __commonJS({ if (destStat && destStat.isFile() && !force) { return; } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path18.join(dest, path18.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path19.join(dest, path19.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -154855,7 +154748,7 @@ var require_io2 = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path18.relative(source, newDest) === "") { + if (path19.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile2(source, newDest, force); @@ -154868,7 +154761,7 @@ var require_io2 = __commonJS({ if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path18.join(dest, path18.basename(source)); + dest = path19.join(dest, path19.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -154879,7 +154772,7 @@ var require_io2 = __commonJS({ } } } - yield mkdirP(path18.dirname(dest)); + yield mkdirP(path19.dirname(dest)); yield ioUtil.rename(source, dest); }); } @@ -154942,7 +154835,7 @@ var require_io2 = __commonJS({ } const extensions = []; if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path18.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path19.delimiter)) { if (extension) { extensions.push(extension); } @@ -154955,12 +154848,12 @@ var require_io2 = __commonJS({ } return []; } - if (tool.includes(path18.sep)) { + if (tool.includes(path19.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path18.delimiter)) { + for (const p of process.env.PATH.split(path19.delimiter)) { if (p) { directories.push(p); } @@ -154968,7 +154861,7 @@ var require_io2 = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path18.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path19.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -155084,7 +154977,7 @@ var require_toolrunner2 = __commonJS({ var os4 = __importStar2(require("os")); var events = __importStar2(require("events")); var child = __importStar2(require("child_process")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var io7 = __importStar2(require_io2()); var ioUtil = __importStar2(require_io_util2()); var timers_1 = require("timers"); @@ -155299,7 +155192,7 @@ var require_toolrunner2 = __commonJS({ exec() { return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path18.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path19.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io7.which(this.toolPath, true); return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { @@ -155799,14 +155692,14 @@ var require_core3 = __commonJS({ var file_command_1 = require_file_command2(); var utils_1 = require_utils12(); var os4 = __importStar2(require("os")); - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); var oidc_utils_1 = require_oidc_utils2(); var ExitCode; (function(ExitCode2) { ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable9(name, val) { + function exportVariable10(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; @@ -155815,7 +155708,7 @@ var require_core3 = __commonJS({ } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable9; + exports2.exportVariable = exportVariable10; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } @@ -155827,7 +155720,7 @@ var require_core3 = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path18.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path19.delimiter}${process.env["PATH"]}`; } exports2.addPath = addPath; function getInput2(name, options) { @@ -156003,13 +155896,13 @@ These characters are not allowed in the artifact name due to limitations with ce (0, core_1.info)(`Artifact name is valid!`); } exports2.checkArtifactName = checkArtifactName; - function checkArtifactFilePath(path18) { - if (!path18) { - throw new Error(`Artifact path: ${path18}, is incorrectly provided`); + function checkArtifactFilePath(path19) { + if (!path19) { + throw new Error(`Artifact path: ${path19}, is incorrectly provided`); } for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path18.includes(invalidCharacterKey)) { - throw new Error(`Artifact path is not valid: ${path18}. Contains the following character: ${errorMessageForCharacter} + if (path19.includes(invalidCharacterKey)) { + throw new Error(`Artifact path is not valid: ${path19}. Contains the following character: ${errorMessageForCharacter} Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} @@ -156100,7 +155993,7 @@ var require_tmp = __commonJS({ "node_modules/tmp/lib/tmp.js"(exports2, module2) { var fs20 = require("fs"); var os4 = require("os"); - var path18 = require("path"); + var path19 = require("path"); var crypto2 = require("crypto"); var _c = { fs: fs20.constants, os: os4.constants }; var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; @@ -156307,35 +156200,35 @@ var require_tmp = __commonJS({ return [actualOptions, callback]; } function _resolvePath(name, tmpDir, cb) { - const pathToResolve = path18.isAbsolute(name) ? name : path18.join(tmpDir, name); + const pathToResolve = path19.isAbsolute(name) ? name : path19.join(tmpDir, name); fs20.stat(pathToResolve, function(err) { if (err) { - fs20.realpath(path18.dirname(pathToResolve), function(err2, parentDir) { + fs20.realpath(path19.dirname(pathToResolve), function(err2, parentDir) { if (err2) return cb(err2); - cb(null, path18.join(parentDir, path18.basename(pathToResolve))); + cb(null, path19.join(parentDir, path19.basename(pathToResolve))); }); } else { - fs20.realpath(path18, cb); + fs20.realpath(path19, cb); } }); } function _resolvePathSync(name, tmpDir) { - const pathToResolve = path18.isAbsolute(name) ? name : path18.join(tmpDir, name); + const pathToResolve = path19.isAbsolute(name) ? name : path19.join(tmpDir, name); try { fs20.statSync(pathToResolve); return fs20.realpathSync(pathToResolve); } catch (_err) { - const parentDir = fs20.realpathSync(path18.dirname(pathToResolve)); - return path18.join(parentDir, path18.basename(pathToResolve)); + const parentDir = fs20.realpathSync(path19.dirname(pathToResolve)); + return path19.join(parentDir, path19.basename(pathToResolve)); } } function _generateTmpName(opts) { const tmpDir = opts.tmpdir; if (!_isUndefined(opts.name)) { - return path18.join(tmpDir, opts.dir, opts.name); + return path19.join(tmpDir, opts.dir, opts.name); } if (!_isUndefined(opts.template)) { - return path18.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); + return path19.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); } const name = [ opts.prefix ? opts.prefix : "tmp", @@ -156345,13 +156238,13 @@ var require_tmp = __commonJS({ _randomChars(12), opts.postfix ? "-" + opts.postfix : "" ].join(""); - return path18.join(tmpDir, opts.dir, name); + return path19.join(tmpDir, opts.dir, name); } function _assertOptionsBase(options) { if (!_isUndefined(options.name)) { const name = options.name; - if (path18.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); - const basename2 = path18.basename(name); + if (path19.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); + const basename2 = path19.basename(name); if (basename2 === ".." || basename2 === "." || basename2 !== name) throw new Error(`name option must not contain a path, found "${name}".`); } @@ -156373,7 +156266,7 @@ var require_tmp = __commonJS({ if (_isUndefined(name)) return cb(null); _resolvePath(name, tmpDir, function(err, resolvedPath) { if (err) return cb(err); - const relativePath = path18.relative(tmpDir, resolvedPath); + const relativePath = path19.relative(tmpDir, resolvedPath); if (!resolvedPath.startsWith(tmpDir)) { return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); } @@ -156383,7 +156276,7 @@ var require_tmp = __commonJS({ function _getRelativePathSync(option, name, tmpDir) { if (_isUndefined(name)) return; const resolvedPath = _resolvePathSync(name, tmpDir); - const relativePath = path18.relative(tmpDir, resolvedPath); + const relativePath = path19.relative(tmpDir, resolvedPath); if (!resolvedPath.startsWith(tmpDir)) { throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); } @@ -156463,14 +156356,14 @@ var require_tmp_promise = __commonJS({ var fileWithOptions = promisify( (options, cb) => tmp.file( options, - (err, path18, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path18, fd, cleanup: promisify(cleanup) }) + (err, path19, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path19, fd, cleanup: promisify(cleanup) }) ) ); module2.exports.file = async (options) => fileWithOptions(options); module2.exports.withFile = async function withFile(fn, options) { - const { path: path18, fd, cleanup } = await module2.exports.file(options); + const { path: path19, fd, cleanup } = await module2.exports.file(options); try { - return await fn({ path: path18, fd }); + return await fn({ path: path19, fd }); } finally { await cleanup(); } @@ -156479,14 +156372,14 @@ var require_tmp_promise = __commonJS({ var dirWithOptions = promisify( (options, cb) => tmp.dir( options, - (err, path18, cleanup) => err ? cb(err) : cb(void 0, { path: path18, cleanup: promisify(cleanup) }) + (err, path19, cleanup) => err ? cb(err) : cb(void 0, { path: path19, cleanup: promisify(cleanup) }) ) ); module2.exports.dir = async (options) => dirWithOptions(options); module2.exports.withDir = async function withDir(fn, options) { - const { path: path18, cleanup } = await module2.exports.dir(options); + const { path: path19, cleanup } = await module2.exports.dir(options); try { - return await fn({ path: path18 }); + return await fn({ path: path19 }); } finally { await cleanup(); } @@ -157436,7 +157329,7 @@ var require_requestUtils2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.retryHttpClientRequest = exports2.retry = void 0; var utils_1 = require_utils13(); - var core17 = __importStar2(require_core3()); + var core18 = __importStar2(require_core3()); var config_variables_1 = require_config_variables(); function retry2(name, operation, customErrorMessages, maxAttempts) { return __awaiter2(this, void 0, void 0, function* () { @@ -157463,13 +157356,13 @@ var require_requestUtils2 = __commonJS({ errorMessage = error3.message; } if (!isRetryable) { - core17.info(`${name} - Error is not retryable`); + core18.info(`${name} - Error is not retryable`); if (response) { (0, utils_1.displayHttpDiagnostics)(response); } break; } - core17.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + core18.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); yield (0, utils_1.sleep)((0, utils_1.getExponentialRetryTimeInMilliseconds)(attempt)); attempt++; } @@ -157553,7 +157446,7 @@ var require_upload_http_client = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadHttpClient = void 0; var fs20 = __importStar2(require("fs")); - var core17 = __importStar2(require_core3()); + var core18 = __importStar2(require_core3()); var tmp = __importStar2(require_tmp_promise()); var stream2 = __importStar2(require("stream")); var utils_1 = require_utils13(); @@ -157618,7 +157511,7 @@ var require_upload_http_client = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const FILE_CONCURRENCY = (0, config_variables_1.getUploadFileConcurrency)(); const MAX_CHUNK_SIZE = (0, config_variables_1.getUploadChunkSize)(); - core17.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`); + core18.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`); const parameters = []; let continueOnError = true; if (options) { @@ -157655,15 +157548,15 @@ var require_upload_http_client = __commonJS({ } const startTime = perf_hooks_1.performance.now(); const uploadFileResult = yield this.uploadFileAsync(index, currentFileParameters); - if (core17.isDebug()) { - core17.debug(`File: ${++completedFiles}/${filesToUpload.length}. ${currentFileParameters.file} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish upload`); + if (core18.isDebug()) { + core18.debug(`File: ${++completedFiles}/${filesToUpload.length}. ${currentFileParameters.file} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish upload`); } uploadFileSize += uploadFileResult.successfulUploadSize; totalFileSize += uploadFileResult.totalSize; if (uploadFileResult.isSuccess === false) { failedItemsToReport.push(currentFileParameters.file); if (!continueOnError) { - core17.error(`aborting artifact upload`); + core18.error(`aborting artifact upload`); abortPendingFileUploads = true; } } @@ -157672,7 +157565,7 @@ var require_upload_http_client = __commonJS({ }))); this.statusReporter.stop(); this.uploadHttpManager.disposeAndReplaceAllClients(); - core17.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`); + core18.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`); return { uploadSize: uploadFileSize, totalSize: totalFileSize, @@ -157698,16 +157591,16 @@ var require_upload_http_client = __commonJS({ let uploadFileSize = 0; let isGzip = true; if (!isFIFO && totalFileSize < 65536) { - core17.debug(`${parameters.file} is less than 64k in size. Creating a gzip file in-memory to potentially reduce the upload size`); + core18.debug(`${parameters.file} is less than 64k in size. Creating a gzip file in-memory to potentially reduce the upload size`); const buffer = yield (0, upload_gzip_1.createGZipFileInBuffer)(parameters.file); let openUploadStream; if (totalFileSize < buffer.byteLength) { - core17.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); + core18.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); openUploadStream = () => fs20.createReadStream(parameters.file); isGzip = false; uploadFileSize = totalFileSize; } else { - core17.debug(`A gzip file created for ${parameters.file} helped with reducing the size of the original file. The file will be uploaded using gzip.`); + core18.debug(`A gzip file created for ${parameters.file} helped with reducing the size of the original file. The file will be uploaded using gzip.`); openUploadStream = () => { const passThrough = new stream2.PassThrough(); passThrough.end(buffer); @@ -157719,7 +157612,7 @@ var require_upload_http_client = __commonJS({ if (!result) { isUploadSuccessful = false; failedChunkSizes += uploadFileSize; - core17.warning(`Aborting upload for ${parameters.file} due to failure`); + core18.warning(`Aborting upload for ${parameters.file} due to failure`); } return { isSuccess: isUploadSuccessful, @@ -157728,16 +157621,16 @@ var require_upload_http_client = __commonJS({ }; } else { const tempFile = yield tmp.file(); - core17.debug(`${parameters.file} is greater than 64k in size. Creating a gzip file on-disk ${tempFile.path} to potentially reduce the upload size`); + core18.debug(`${parameters.file} is greater than 64k in size. Creating a gzip file on-disk ${tempFile.path} to potentially reduce the upload size`); uploadFileSize = yield (0, upload_gzip_1.createGZipFileOnDisk)(parameters.file, tempFile.path); let uploadFilePath = tempFile.path; if (!isFIFO && totalFileSize < uploadFileSize) { - core17.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); + core18.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`); uploadFileSize = totalFileSize; uploadFilePath = parameters.file; isGzip = false; } else { - core17.debug(`The gzip file created for ${parameters.file} is smaller than the original file. The file will be uploaded using gzip.`); + core18.debug(`The gzip file created for ${parameters.file} is smaller than the original file. The file will be uploaded using gzip.`); } let abortFileUpload = false; while (offset < uploadFileSize) { @@ -157757,7 +157650,7 @@ var require_upload_http_client = __commonJS({ if (!result) { isUploadSuccessful = false; failedChunkSizes += chunkSize; - core17.warning(`Aborting upload for ${parameters.file} due to failure`); + core18.warning(`Aborting upload for ${parameters.file} due to failure`); abortFileUpload = true; } else { if (uploadFileSize > 8388608) { @@ -157765,7 +157658,7 @@ var require_upload_http_client = __commonJS({ } } } - core17.debug(`deleting temporary gzip file ${tempFile.path}`); + core18.debug(`deleting temporary gzip file ${tempFile.path}`); yield tempFile.cleanup(); return { isSuccess: isUploadSuccessful, @@ -157804,7 +157697,7 @@ var require_upload_http_client = __commonJS({ if (response) { (0, utils_1.displayHttpDiagnostics)(response); } - core17.info(`Retry limit has been reached for chunk at offset ${start} to ${resourceUrl}`); + core18.info(`Retry limit has been reached for chunk at offset ${start} to ${resourceUrl}`); return true; } return false; @@ -157812,14 +157705,14 @@ var require_upload_http_client = __commonJS({ const backOff = (retryAfterValue) => __awaiter2(this, void 0, void 0, function* () { this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex); if (retryAfterValue) { - core17.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`); + core18.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`); yield (0, utils_1.sleep)(retryAfterValue); } else { const backoffTime = (0, utils_1.getExponentialRetryTimeInMilliseconds)(retryCount); - core17.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); + core18.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); yield (0, utils_1.sleep)(backoffTime); } - core17.info(`Finished backoff for retry #${retryCount}, continuing with upload`); + core18.info(`Finished backoff for retry #${retryCount}, continuing with upload`); return; }); while (retryCount <= retryLimit) { @@ -157827,7 +157720,7 @@ var require_upload_http_client = __commonJS({ try { response = yield uploadChunkRequest(); } catch (error3) { - core17.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); + core18.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); console.log(error3); if (incrementAndCheckRetryLimit()) { return false; @@ -157839,13 +157732,13 @@ var require_upload_http_client = __commonJS({ if ((0, utils_1.isSuccessStatusCode)(response.message.statusCode)) { return true; } else if ((0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { - core17.info(`A ${response.message.statusCode} status code has been received, will attempt to retry the upload`); + core18.info(`A ${response.message.statusCode} status code has been received, will attempt to retry the upload`); if (incrementAndCheckRetryLimit(response)) { return false; } (0, utils_1.isThrottledStatusCode)(response.message.statusCode) ? yield backOff((0, utils_1.tryGetRetryAfterValueTimeInMilliseconds)(response.message.headers)) : yield backOff(); } else { - core17.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`); + core18.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`); (0, utils_1.displayHttpDiagnostics)(response); return false; } @@ -157863,7 +157756,7 @@ var require_upload_http_client = __commonJS({ resourceUrl.searchParams.append("artifactName", artifactName); const parameters = { Size: size }; const data = JSON.stringify(parameters, null, 2); - core17.debug(`URL is ${resourceUrl.toString()}`); + core18.debug(`URL is ${resourceUrl.toString()}`); const client = this.uploadHttpManager.getClient(0); const headers = (0, utils_1.getUploadHeaders)("application/json", false); const customErrorMessages = /* @__PURE__ */ new Map([ @@ -157876,7 +157769,7 @@ var require_upload_http_client = __commonJS({ return client.patch(resourceUrl.toString(), data, headers); }), customErrorMessages); yield response.readBody(); - core17.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); + core18.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); }); } }; @@ -157945,7 +157838,7 @@ var require_download_http_client = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DownloadHttpClient = void 0; var fs20 = __importStar2(require("fs")); - var core17 = __importStar2(require_core3()); + var core18 = __importStar2(require_core3()); var zlib3 = __importStar2(require("zlib")); var utils_1 = require_utils13(); var url_1 = require("url"); @@ -157999,11 +157892,11 @@ var require_download_http_client = __commonJS({ downloadSingleArtifact(downloadItems) { return __awaiter2(this, void 0, void 0, function* () { const DOWNLOAD_CONCURRENCY = (0, config_variables_1.getDownloadFileConcurrency)(); - core17.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); + core18.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; let currentFile = 0; let downloadedFiles = 0; - core17.info(`Total number of files that will be downloaded: ${downloadItems.length}`); + core18.info(`Total number of files that will be downloaded: ${downloadItems.length}`); this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); this.statusReporter.start(); yield Promise.all(parallelDownloads.map((index) => __awaiter2(this, void 0, void 0, function* () { @@ -158012,8 +157905,8 @@ var require_download_http_client = __commonJS({ currentFile += 1; const startTime = perf_hooks_1.performance.now(); yield this.downloadIndividualFile(index, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath); - if (core17.isDebug()) { - core17.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); + if (core18.isDebug()) { + core18.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); } this.statusReporter.incrementProcessedCount(); } @@ -158051,19 +157944,19 @@ var require_download_http_client = __commonJS({ } else { this.downloadHttpManager.disposeAndReplaceClient(httpClientIndex); if (retryAfterValue) { - core17.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the download`); + core18.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the download`); yield (0, utils_1.sleep)(retryAfterValue); } else { const backoffTime = (0, utils_1.getExponentialRetryTimeInMilliseconds)(retryCount); - core17.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); + core18.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); yield (0, utils_1.sleep)(backoffTime); } - core17.info(`Finished backoff for retry #${retryCount}, continuing with download`); + core18.info(`Finished backoff for retry #${retryCount}, continuing with download`); } }); const isAllBytesReceived = (expected, received) => { if (!expected || !received || process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]) { - core17.info("Skipping download validation."); + core18.info("Skipping download validation."); return true; } return parseInt(expected) === received; @@ -158084,7 +157977,7 @@ var require_download_http_client = __commonJS({ try { response = yield makeDownloadRequest(); } catch (error3) { - core17.info("An error occurred while attempting to download a file"); + core18.info("An error occurred while attempting to download a file"); console.log(error3); yield backOff(); continue; @@ -158104,7 +157997,7 @@ var require_download_http_client = __commonJS({ } } if (forceRetry || (0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { - core17.info(`A ${response.message.statusCode} response code has been received while attempting to download an artifact`); + core18.info(`A ${response.message.statusCode} response code has been received while attempting to download an artifact`); resetDestinationStream(downloadPath); (0, utils_1.isThrottledStatusCode)(response.message.statusCode) ? yield backOff((0, utils_1.tryGetRetryAfterValueTimeInMilliseconds)(response.message.headers)) : yield backOff(); } else { @@ -158126,29 +158019,29 @@ var require_download_http_client = __commonJS({ if (isGzip) { const gunzip = zlib3.createGunzip(); response.message.on("error", (error3) => { - core17.info(`An error occurred while attempting to read the response stream`); + core18.info(`An error occurred while attempting to read the response stream`); gunzip.close(); destinationStream.close(); reject(error3); }).pipe(gunzip).on("error", (error3) => { - core17.info(`An error occurred while attempting to decompress the response stream`); + core18.info(`An error occurred while attempting to decompress the response stream`); destinationStream.close(); reject(error3); }).pipe(destinationStream).on("close", () => { resolve8(); }).on("error", (error3) => { - core17.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); + core18.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); reject(error3); }); } else { response.message.on("error", (error3) => { - core17.info(`An error occurred while attempting to read the response stream`); + core18.info(`An error occurred while attempting to read the response stream`); destinationStream.close(); reject(error3); }).pipe(destinationStream).on("close", () => { resolve8(); }).on("error", (error3) => { - core17.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); + core18.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); reject(error3); }); } @@ -158194,21 +158087,21 @@ var require_download_specification = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDownloadSpecification = void 0; - var path18 = __importStar2(require("path")); + var path19 = __importStar2(require("path")); function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { const directories = /* @__PURE__ */ new Set(); const specifications = { - rootDownloadLocation: includeRootDirectory ? path18.join(downloadPath, artifactName) : downloadPath, + rootDownloadLocation: includeRootDirectory ? path19.join(downloadPath, artifactName) : downloadPath, directoryStructure: [], emptyFilesToCreate: [], filesToDownload: [] }; for (const entry of artifactEntries) { if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { - const normalizedPathEntry = path18.normalize(entry.path); - const filePath = path18.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); + const normalizedPathEntry = path19.normalize(entry.path); + const filePath = path19.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); if (entry.itemType === "file") { - directories.add(path18.dirname(filePath)); + directories.add(path19.dirname(filePath)); if (entry.fileLength === 0) { specifications.emptyFilesToCreate.push(filePath); } else { @@ -158287,7 +158180,7 @@ var require_artifact_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultArtifactClient = void 0; - var core17 = __importStar2(require_core3()); + var core18 = __importStar2(require_core3()); var upload_specification_1 = require_upload_specification(); var upload_http_client_1 = require_upload_http_client(); var utils_1 = require_utils13(); @@ -158308,7 +158201,7 @@ var require_artifact_client = __commonJS({ */ uploadArtifact(name, files, rootDirectory, options) { return __awaiter2(this, void 0, void 0, function* () { - core17.info(`Starting artifact upload + core18.info(`Starting artifact upload For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging`); (0, path_and_artifact_name_validation_1.checkArtifactName)(name); const uploadSpecification = (0, upload_specification_1.getUploadSpecification)(name, rootDirectory, files); @@ -158320,24 +158213,24 @@ For more detailed logs during the artifact upload process, enable step-debugging }; const uploadHttpClient = new upload_http_client_1.UploadHttpClient(); if (uploadSpecification.length === 0) { - core17.warning(`No files found that can be uploaded`); + core18.warning(`No files found that can be uploaded`); } else { const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); if (!response.fileContainerResourceUrl) { - core17.debug(response.toString()); + core18.debug(response.toString()); throw new Error("No URL provided by the Artifact Service to upload an artifact to"); } - core17.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); - core17.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); + core18.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); + core18.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); - core17.info(`File upload process has finished. Finalizing the artifact upload`); + core18.info(`File upload process has finished. Finalizing the artifact upload`); yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); if (uploadResult.failedItems.length > 0) { - core17.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); + core18.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); } else { - core17.info(`Artifact has been finalized. All files have been successfully uploaded!`); + core18.info(`Artifact has been finalized. All files have been successfully uploaded!`); } - core17.info(` + core18.info(` The raw size of all the files that were specified for upload is ${uploadResult.totalSize} bytes The size of all the files that were uploaded is ${uploadResult.uploadSize} bytes. This takes into account any gzip compression used to reduce the upload size, time and storage @@ -158350,7 +158243,7 @@ Note: The size of downloaded zips can differ significantly from the reported siz return uploadResponse; }); } - downloadArtifact(name, path18, options) { + downloadArtifact(name, path19, options) { return __awaiter2(this, void 0, void 0, function* () { const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); const artifacts = yield downloadHttpClient.listArtifacts(); @@ -158364,17 +158257,17 @@ Note: The size of downloaded zips can differ significantly from the reported siz throw new Error(`Unable to find an artifact with the name: ${name}`); } const items = yield downloadHttpClient.getContainerItems(artifactToDownload.name, artifactToDownload.fileContainerResourceUrl); - if (!path18) { - path18 = (0, config_variables_1.getWorkSpaceDirectory)(); + if (!path19) { + path19 = (0, config_variables_1.getWorkSpaceDirectory)(); } - path18 = (0, path_1.normalize)(path18); - path18 = (0, path_1.resolve)(path18); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path18, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); + path19 = (0, path_1.normalize)(path19); + path19 = (0, path_1.resolve)(path19); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path19, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); if (downloadSpecification.filesToDownload.length === 0) { - core17.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); + core18.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); } else { yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); - core17.info("Directory structure has been set up for the artifact"); + core18.info("Directory structure has been set up for the artifact"); yield (0, utils_1.createEmptyFilesForArtifact)(downloadSpecification.emptyFilesToCreate); yield downloadHttpClient.downloadSingleArtifact(downloadSpecification.filesToDownload); } @@ -158384,29 +158277,29 @@ Note: The size of downloaded zips can differ significantly from the reported siz }; }); } - downloadAllArtifacts(path18) { + downloadAllArtifacts(path19) { return __awaiter2(this, void 0, void 0, function* () { const downloadHttpClient = new download_http_client_1.DownloadHttpClient(); const response = []; const artifacts = yield downloadHttpClient.listArtifacts(); if (artifacts.count === 0) { - core17.info("Unable to find any artifacts for the associated workflow"); + core18.info("Unable to find any artifacts for the associated workflow"); return response; } - if (!path18) { - path18 = (0, config_variables_1.getWorkSpaceDirectory)(); + if (!path19) { + path19 = (0, config_variables_1.getWorkSpaceDirectory)(); } - path18 = (0, path_1.normalize)(path18); - path18 = (0, path_1.resolve)(path18); + path19 = (0, path_1.normalize)(path19); + path19 = (0, path_1.resolve)(path19); let downloadedArtifacts = 0; while (downloadedArtifacts < artifacts.count) { const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; downloadedArtifacts += 1; - core17.info(`starting download of artifact ${currentArtifactToDownload.name} : ${downloadedArtifacts}/${artifacts.count}`); + core18.info(`starting download of artifact ${currentArtifactToDownload.name} : ${downloadedArtifacts}/${artifacts.count}`); const items = yield downloadHttpClient.getContainerItems(currentArtifactToDownload.name, currentArtifactToDownload.fileContainerResourceUrl); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(currentArtifactToDownload.name, items.value, path18, true); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(currentArtifactToDownload.name, items.value, path19, true); if (downloadSpecification.filesToDownload.length === 0) { - core17.info(`No downloadable files were found for any artifact ${currentArtifactToDownload.name}`); + core18.info(`No downloadable files were found for any artifact ${currentArtifactToDownload.name}`); } else { yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); yield (0, utils_1.createEmptyFilesForArtifact)(downloadSpecification.emptyFilesToCreate); @@ -161336,7 +161229,7 @@ var require_sarif_schema_2_1_0 = __commonJS({ }); // src/init-action-post.ts -var core16 = __toESM(require_core()); +var core17 = __toESM(require_core()); // src/actions-util.ts var fs2 = __toESM(require("fs")); @@ -164001,6 +163894,14 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.21"; var minimumVersion = "3.14"; +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isString(value) { + return typeof value === "string"; +} + // src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; var BROKEN_VERSIONS = ["0.0.0-20211207"]; @@ -164111,7 +164012,7 @@ var HTTPError = class extends Error { var ConfigurationError = class extends Error { }; function asHTTPError(arg) { - if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { + if (!isObject2(arg) || !isString(arg.message)) { return void 0; } if (Number.isInteger(arg.status)) { @@ -164304,9 +164205,36 @@ async function asyncSome(array, predicate) { const results = await Promise.all(array.map(predicate)); return results.some((result) => result); } +var Success = class { + constructor(value) { + this.value = value; + } + isSuccess() { + return true; + } + isFailure() { + return false; + } + orElse(_defaultValue) { + return this.value; + } +}; +var Failure = class { + constructor(value) { + this.value = value; + } + isSuccess() { + return false; + } + isFailure() { + return true; + } + orElse(defaultValue) { + return defaultValue; + } +}; // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -164323,7 +164251,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -164624,6 +164552,7 @@ function parseRepositoryNwo(input) { // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -164638,10 +164567,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -165100,6 +165026,7 @@ var semver2 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -165351,8 +165278,8 @@ var getFileOidsUnderPath = async function(basePath) { const match = line.match(regex); if (match) { const oid = match[1]; - const path18 = decodeGitFilePath(match[2]); - fileOidMap[path18] = oid; + const path19 = decodeGitFilePath(match[2]); + fileOidMap[path19] = oid; } else { throw new Error(`Unexpected "git ls-files" output: ${line}`); } @@ -165427,6 +165354,12 @@ async function isAnalyzingDefaultBranch() { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -165572,70 +165505,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -165647,25 +165558,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -165675,23 +165581,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -165707,11 +165603,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -165729,11 +165622,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -166148,28 +166036,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; function getPathToParsedConfigFile(tempDir) { return path8.join(tempDir, "config"); @@ -166216,6 +166096,9 @@ function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) { function isCodeScanningEnabled(config) { return config.analysisKinds.includes("code-scanning" /* CodeScanning */); } +function isRiskAssessmentEnabled(config) { + return config.analysisKinds.includes("risk-assessment" /* RiskAssessment */); +} // src/setup-codeql.ts var fs10 = __toESM(require("fs")); @@ -168214,7 +168097,7 @@ function getArtifactSuffix(matrix) { if (matrix) { try { const matrixObject = JSON.parse(matrix); - if (matrixObject !== null && typeof matrixObject === "object") { + if (isObject2(matrixObject)) { for (const matrixKey of Object.keys(matrixObject).sort()) suffix += `-${matrixObject[matrixKey]}`; } else { @@ -168317,14 +168200,15 @@ async function createDatabaseBundleCli(codeql, config, language) { // src/init-action-post-helper.ts var fs19 = __toESM(require("fs")); -var github2 = __toESM(require_github()); +var import_path3 = __toESM(require("path")); +var github3 = __toESM(require_github()); // src/upload-lib.ts var fs17 = __toESM(require("fs")); var path16 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); -var core13 = __toESM(require_core()); +var core14 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib2()); // src/fingerprints.ts @@ -169354,7 +169238,7 @@ function locationUpdateCallback(result, location, logger) { } function resolveUriToFile(location, artifacts, sourceRoot, logger) { if (!location.uri && location.index !== void 0) { - if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") { + if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || !isObject2(artifacts[location.index].location)) { logger.debug(`Ignoring location as index "${location.index}" is invalid`); return void 0; } @@ -169406,9 +169290,9 @@ async function addFingerprints(sarifLog, sourceRoot, logger) { `Adding fingerprints to SARIF file. See ${"https://docs.github.com/en/code-security/reference/code-scanning/sarif-support-for-code-scanning#data-for-preventing-duplicated-alerts" /* TRACK_CODE_SCANNING_ALERTS_ACROSS_RUNS */} for more information.` ); const callbacksByFile = {}; - for (const run3 of sarifLog.runs || []) { - const artifacts = run3.artifacts || []; - for (const result of run3.results || []) { + for (const run2 of sarifLog.runs || []) { + const artifacts = run2.artifacts || []; + for (const result of run2.results || []) { const primaryLocation = (result.locations || [])[0]; if (!primaryLocation?.physicalLocation?.artifactLocation) { logger.debug( @@ -169450,7 +169334,9 @@ async function addFingerprints(sarifLog, sourceRoot, logger) { } // src/init.ts +var core13 = __toESM(require_core()); var toolrunner4 = __toESM(require_toolrunner()); +var github2 = __toESM(require_github()); var io6 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); @@ -169487,8 +169373,8 @@ var InvalidSarifUploadError = class extends Error { }; function getToolNames(sarifFile) { const toolNames = {}; - for (const run3 of sarifFile.runs || []) { - const tool = run3.tool || {}; + for (const run2 of sarifFile.runs || []) { + const tool = run2.tool || {}; const driver = tool.driver || {}; if (typeof driver.name === "string" && driver.name.length > 0) { toolNames[driver.name] = true; @@ -169522,17 +169408,17 @@ function combineSarifFiles(sarifFiles, logger) { } function areAllRunsProducedByCodeQL(sarifLogs) { return sarifLogs.every((sarifLog) => { - return sarifLog.runs?.every((run3) => run3.tool?.driver?.name === "CodeQL"); + return sarifLog.runs?.every((run2) => run2.tool?.driver?.name === "CodeQL"); }); } -function createRunKey(run3) { +function createRunKey(run2) { return { - name: run3.tool?.driver?.name, - fullName: run3.tool?.driver?.fullName, - version: run3.tool?.driver?.version, - semanticVersion: run3.tool?.driver?.semanticVersion, - guid: run3.tool?.driver?.guid, - automationId: run3.automationDetails?.id + name: run2.tool?.driver?.name, + fullName: run2.tool?.driver?.fullName, + version: run2.tool?.driver?.version, + semanticVersion: run2.tool?.driver?.semanticVersion, + guid: run2.tool?.driver?.guid, + automationId: run2.automationDetails?.id }; } function areAllRunsUnique(sarifLogs) { @@ -169541,8 +169427,8 @@ function areAllRunsUnique(sarifLogs) { if (sarifLog.runs === void 0) { continue; } - for (const run3 of sarifLog.runs) { - const key = JSON.stringify(createRunKey(run3)); + for (const run2 of sarifLog.runs) { + const key = JSON.stringify(createRunKey(run2)); if (keys.has(key)) { return false; } @@ -169555,10 +169441,7 @@ function areAllRunsUnique(sarifLogs) { // src/upload-lib.ts var GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning."; var GENERIC_404_MSG = "The CodeQL code scanning feature is forbidden on this repository."; -async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) { - if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { - return false; - } +async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects) { return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING; } async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) { @@ -169591,14 +169474,11 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo logger.debug( "Not all SARIF files were produced by CodeQL. Merging files in the action." ); - if (await shouldShowCombineSarifFilesDeprecationWarning( - sarifObjects, - gitHubVersion - )) { + if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects)) { logger.warning( `Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}` ); - core13.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); + core14.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); } return combineSarifFiles(sarifFiles, logger); } @@ -169647,9 +169527,9 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo function populateRunAutomationDetails(sarifFile, category, analysis_key, environment) { const automationID = getAutomationID2(category, analysis_key, environment); if (automationID !== void 0) { - for (const run3 of sarifFile.runs || []) { - if (run3.automationDetails === void 0) { - run3.automationDetails = { + for (const run2 of sarifFile.runs || []) { + if (run2.automationDetails === void 0) { + run2.automationDetails = { id: automationID }; } @@ -169697,13 +169577,13 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { if (httpError !== void 0) { switch (httpError.status) { case 403: - core13.warning(httpError.message || GENERIC_403_MSG); + core14.warning(httpError.message || GENERIC_403_MSG); break; case 404: - core13.warning(httpError.message || GENERIC_404_MSG); + core14.warning(httpError.message || GENERIC_404_MSG); break; default: - core13.warning(httpError.message); + core14.warning(httpError.message); break; } } @@ -169748,13 +169628,13 @@ function countResultsInSarif(sarifLog) { if (!Array.isArray(parsedSarif.runs)) { throw new InvalidSarifUploadError("Invalid SARIF. Missing 'runs' array."); } - for (const run3 of parsedSarif.runs) { - if (!Array.isArray(run3.results)) { + for (const run2 of parsedSarif.runs) { + if (!Array.isArray(run2.results)) { throw new InvalidSarifUploadError( "Invalid SARIF. Missing 'results' array in run." ); } - numResults += run3.results.length; + numResults += run2.results.length; } return numResults; } @@ -170048,9 +169928,9 @@ function handleProcessingResultForUnsuccessfulExecution(response, status, logger } function validateUniqueCategory(sarifLog, sentinelPrefix) { const categories = {}; - for (const run3 of sarifLog.runs || []) { - const id = run3?.automationDetails?.id; - const tool = run3.tool?.driver?.name; + for (const run2 of sarifLog.runs || []) { + const id = run2?.automationDetails?.id; + const tool = run2.tool?.driver?.name; const category = `${sanitize(id)}_${sanitize(tool)}`; categories[category] = { id, tool }; } @@ -170061,7 +169941,7 @@ function validateUniqueCategory(sarifLog, sentinelPrefix) { `Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. The easiest fix is to specify a unique value for the \`category\` input. If .runs[].automationDetails.id is specified in the sarif file, that will take precedence over your configured \`category\`. Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})` ); } - core13.exportVariable(sentinelEnvVar, sentinelEnvVar); + core14.exportVariable(sentinelEnvVar, sentinelEnvVar); } } function sanitize(str2) { @@ -170076,9 +169956,9 @@ function filterAlertsByDiffRange(logger, sarifLog) { return sarifLog; } const checkoutPath = getRequiredInput("checkout_path"); - for (const run3 of sarifLog.runs) { - if (run3.results) { - run3.results = run3.results.filter((result) => { + for (const run2 of sarifLog.runs) { + if (run2.results) { + run2.results = run2.results.filter((result) => { const locations = [ ...(result.locations || []).map((loc) => loc.physicalLocation), ...(result.relatedLocations || []).map((loc) => loc.physicalLocation) @@ -170104,7 +169984,7 @@ function filterAlertsByDiffRange(logger, sarifLog) { var fs18 = __toESM(require("fs")); var path17 = __toESM(require("path")); var import_zlib2 = __toESM(require("zlib")); -var core14 = __toESM(require_core()); +var core15 = __toESM(require_core()); function toCodedErrors(errors) { return Object.entries(errors).reduce( (acc, [code, message]) => { @@ -170240,34 +170120,81 @@ function createFailedUploadFailedSarifResult(error3) { upload_failed_run_stack_trace: wrappedError.stack }; } -async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) { +async function prepareFailedSarif(logger, features, config) { if (!config.codeQLCmd) { - return { upload_failed_run_skipped_because: "CodeQL command not found" }; + return new Failure({ + upload_failed_run_skipped_because: "CodeQL command not found" + }); } - const workflow = await getWorkflow(logger); const jobName = getRequiredEnvParam("GITHUB_JOB"); const matrix = parseMatrixInput(getRequiredInput("matrix")); - const shouldUpload = getUploadInputOrThrow(workflow, jobName, matrix); - if (!["always", "failure-only"].includes( - getUploadValue(shouldUpload) - ) || shouldSkipSarifUpload()) { - return { upload_failed_run_skipped_because: "SARIF upload is disabled" }; - } - const category = getCategoryInputOrThrow(workflow, jobName, matrix); - const checkoutPath = getCheckoutPathInputOrThrow(workflow, jobName, matrix); + if (shouldSkipSarifUpload()) { + return new Failure({ + upload_failed_run_skipped_because: "SARIF upload is disabled" + }); + } + if (isRiskAssessmentEnabled(config)) { + if (config.languages.length !== 1) { + return new Failure({ + upload_failed_run_skipped_because: "Unexpectedly, the configuration is not for a single language." + }); + } + const language = config.languages[0]; + const category = `/language:${language}`; + const checkoutPath = "."; + const result = await generateFailedSarif( + features, + config, + category, + checkoutPath, + `../codeql-failed-sarif-${language}${RiskAssessment.sarifExtension}` + ); + return new Success(result); + } else { + const workflow = await getWorkflow(logger); + const shouldUpload = getUploadInputOrThrow(workflow, jobName, matrix); + if (!["always", "failure-only"].includes( + getUploadValue(shouldUpload) + )) { + return new Failure({ + upload_failed_run_skipped_because: "SARIF upload is disabled" + }); + } + const category = getCategoryInputOrThrow(workflow, jobName, matrix); + const checkoutPath = getCheckoutPathInputOrThrow(workflow, jobName, matrix); + const result = await generateFailedSarif( + features, + config, + category, + checkoutPath + ); + return new Success(result); + } +} +async function generateFailedSarif(features, config, category, checkoutPath, sarifFile) { const databasePath = config.dbLocation; const codeql = await getCodeQL(config.codeQLCmd); - const sarifFile = "../codeql-failed-run.sarif"; + if (sarifFile === void 0) { + sarifFile = "../codeql-failed-run.sarif"; + } if (databasePath === void 0 || !await features.getValue("export_diagnostics_enabled" /* ExportDiagnosticsEnabled */, codeql)) { await codeql.diagnosticsExport(sarifFile, category, config); } else { await codeql.databaseExportDiagnostics(databasePath, sarifFile, category); } - logger.info(`Uploading failed SARIF file ${sarifFile}`); + return { sarifFile, category, checkoutPath }; +} +async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) { + const failedSarifResult = await prepareFailedSarif(logger, features, config); + if (failedSarifResult.isFailure()) { + return failedSarifResult.value; + } + const failedSarif = failedSarifResult.value; + logger.info(`Uploading failed SARIF file ${failedSarif.sarifFile}`); const uploadResult = await uploadFiles( - sarifFile, - checkoutPath, - category, + failedSarif.sarifFile, + failedSarif.checkoutPath, + failedSarif.category, features, logger, CodeScanning @@ -170280,24 +170207,47 @@ async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) { ); return uploadResult ? { ...uploadResult.statusReport, sarifID: uploadResult.sarifID } : {}; } -async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger) { - if (!isCodeScanningEnabled(config)) { - return { - upload_failed_run_skipped_because: "Code Scanning is not enabled." - }; +async function maybeUploadFailedSarifArtifact(config, features, logger) { + const failedSarifResult = await prepareFailedSarif(logger, features, config); + if (failedSarifResult.isFailure()) { + return failedSarifResult.value; } + const failedSarif = failedSarifResult.value; + logger.info( + `Uploading failed SARIF file ${failedSarif.sarifFile} as artifact` + ); + const gitHubVersion = await getGitHubVersion(); + const client = await getArtifactUploaderClient(logger, gitHubVersion.type); + const suffix = getArtifactSuffix(getOptionalInput("matrix")); + const name = sanitizeArtifactName(`sarif-artifact-${suffix}`); + await client.uploadArtifact( + name, + [import_path3.default.normalize(failedSarif.sarifFile)], + import_path3.default.normalize("..") + ); + return { sarifID: name }; +} +async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger) { if (process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true") { return { upload_failed_run_skipped_because: "Analyze Action completed successfully" }; } try { - return await maybeUploadFailedSarif( - config, - repositoryNwo, - features, - logger - ); + if (isCodeScanningEnabled(config)) { + return await maybeUploadFailedSarif( + config, + repositoryNwo, + features, + logger + ); + } else if (isRiskAssessmentEnabled(config)) { + return await maybeUploadFailedSarifArtifact(config, features, logger); + } else { + return { + upload_failed_run_skipped_because: "No analysis kind that supports failed SARIF uploads is enabled." + }; + } } catch (e) { logger.debug( `Failed to upload a SARIF file for this failed CodeQL code scanning run. ${e}` @@ -170305,7 +170255,7 @@ async function tryUploadSarifIfRunFailed(config, repositoryNwo, features, logger return createFailedUploadFailedSarifResult(e); } } -async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, config, repositoryNwo, features, logger) { +async function uploadFailureInfo(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, config, repositoryNwo, features, logger) { await recordOverlayStatus(codeql, config, features, logger); const uploadFailedSarifResult = await tryUploadSarifIfRunFailed( config, @@ -170315,7 +170265,7 @@ async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, co ); if (uploadFailedSarifResult.upload_failed_run_skipped_because) { logger.debug( - `Won't upload a failed SARIF file for this CodeQL code scanning run because: ${uploadFailedSarifResult.upload_failed_run_skipped_because}.` + `Won't upload a failed SARIF file for this CodeQL analysis because: ${uploadFailedSarifResult.upload_failed_run_skipped_because}.` ); } if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" && !uploadFailedSarifResult.raw_upload_size_bytes) { @@ -170325,7 +170275,7 @@ async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, co ); } if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") { - if (!github2.context.payload.pull_request?.head.repo.fork) { + if (!github3.context.payload.pull_request?.head.repo.fork) { await removeUploadedSarif(uploadFailedSarifResult, logger); } else { logger.info( @@ -170468,7 +170418,7 @@ async function removeUploadedSarif(uploadFailedSarifResult, logger) { // src/status-report.ts var os3 = __toESM(require("os")); -var core15 = __toESM(require_core()); +var core16 = __toESM(require_core()); function isFirstPartyAnalysis(actionName) { if (actionName !== "upload-sarif" /* UploadSarif */) { return true; @@ -170505,12 +170455,12 @@ function getJobStatusDisplayName(status) { } function setJobStatusIfUnsuccessful(actionStatus) { if (actionStatus === "user-error") { - core15.exportVariable( + core16.exportVariable( "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */ ); } else if (actionStatus === "failure" || actionStatus === "aborted") { - core15.exportVariable( + core16.exportVariable( "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_FAILURE" /* FailureStatus */ ); @@ -170529,14 +170479,14 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi let workflowStartedAt = process.env["CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */]; if (workflowStartedAt === void 0) { workflowStartedAt = actionStartedAt.toISOString(); - core15.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); + core16.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); } const runnerOs = getRequiredEnvParam("RUNNER_OS"); const codeQlCliVersion = getCachedCodeQlVersion(); const actionRef = process.env["GITHUB_ACTION_REF"] || ""; const testingEnvironment = getTestingEnvironment(); if (testingEnvironment) { - core15.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); + core16.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); } const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true"; const statusReport = { @@ -170619,9 +170569,9 @@ var INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the API endpo async function sendStatusReport(statusReport) { setJobStatusIfUnsuccessful(statusReport.status); const statusReportJSON = JSON.stringify(statusReport); - core15.debug(`Sending status report: ${statusReportJSON}`); + core16.debug(`Sending status report: ${statusReportJSON}`); if (isInTestMode()) { - core15.debug("In test mode. Status reports are not uploaded."); + core16.debug("In test mode. Status reports are not uploaded."); return; } const nwo = getRepositoryNwo(); @@ -170641,28 +170591,28 @@ async function sendStatusReport(statusReport) { switch (httpError.status) { case 403: if (getWorkflowEventName() === "push" && process.env["GITHUB_ACTOR"] === "dependabot[bot]") { - core15.warning( + core16.warning( `Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading CodeQL results requires write access. To use CodeQL with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push" /* SCANNING_ON_PUSH */} for more information on how to configure these events.` ); } else { - core15.warning( + core16.warning( `This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. This could be because the Action is running on a pull request from a fork. If not, please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}` ); } return; case 404: - core15.warning(httpError.message); + core16.warning(httpError.message); return; case 422: if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) { - core15.debug(INCOMPATIBLE_MSG); + core16.debug(INCOMPATIBLE_MSG); } else { - core15.debug(OUT_OF_DATE_MSG); + core16.debug(OUT_OF_DATE_MSG); } return; } } - core15.warning( + core16.warning( `An unexpected error occurred when sending a status report: ${getErrorMessage( e )}` @@ -170695,7 +170645,7 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error } // src/init-action-post.ts -async function run2(startedAt) { +async function run(startedAt) { const logger = getActionsLogger(); let config; let uploadFailedSarifResult; @@ -170718,7 +170668,7 @@ async function run2(startedAt) { ); } else { const codeql = await getCodeQL(config.codeQLCmd); - uploadFailedSarifResult = await run( + uploadFailedSarifResult = await uploadFailureInfo( tryUploadAllAvailableDebugArtifacts, printDebugLogs, codeql, @@ -170733,7 +170683,7 @@ async function run2(startedAt) { } } catch (unwrappedError) { const error3 = wrapError(unwrappedError); - core16.setFailed(error3.message); + core17.setFailed(error3.message); const statusReportBase2 = await createStatusReportBase( "init-post" /* InitPost */, getActionsStatus(error3), @@ -170778,14 +170728,14 @@ function getFinalJobStatus(config) { } let jobStatus; if (process.env["CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */] === "true") { - core16.exportVariable("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, "JOB_STATUS_SUCCESS" /* SuccessStatus */); + core17.exportVariable("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, "JOB_STATUS_SUCCESS" /* SuccessStatus */); jobStatus = "JOB_STATUS_SUCCESS" /* SuccessStatus */; } else if (config !== void 0) { jobStatus = "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */; } else { jobStatus = "JOB_STATUS_UNKNOWN" /* UnknownStatus */; } - core16.exportVariable("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, jobStatus); + core17.exportVariable("CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, jobStatus); return jobStatus; } function getJobStatusFromEnvironment() { @@ -170802,9 +170752,9 @@ async function runWrapper() { const startedAt = /* @__PURE__ */ new Date(); const logger = getActionsLogger(); try { - await run2(startedAt); + await run(startedAt); } catch (error3) { - core16.setFailed(`init post action failed: ${wrapError(error3).message}`); + core17.setFailed(`init post action failed: ${wrapError(error3).message}`); await sendUnhandledErrorStatusReport( "init-post" /* InitPost */, startedAt, diff --git a/lib/init-action.js b/lib/init-action.js index 52d20e1270..1b3244b10e 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -3842,18 +3842,18 @@ var require_webidl = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context3) { - const plural = context3.types.length === 1 ? "" : " one of"; - const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context4) { + const plural = context4.types.length === 1 ? "" : " one of"; + const message = `${context4.argument} could not be converted to${plural}: ${context4.types.join(", ")}.`; return webidl.errors.exception({ - header: context3.prefix, + header: context4.prefix, message }); }; - webidl.errors.invalidArgument = function(context3) { + webidl.errors.invalidArgument = function(context4) { return webidl.errors.exception({ - header: context3.prefix, - message: `"${context3.value}" is an invalid ${context3.type}.` + header: context4.prefix, + message: `"${context4.value}" is an invalid ${context4.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -9849,17 +9849,17 @@ var require_api_request = __commonJS({ } } } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context4, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -9896,7 +9896,7 @@ var require_api_request = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context3 + context: context4 }); } } @@ -10065,17 +10065,17 @@ var require_api_stream = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context3, callback, responseHeaders } = this; + const { factory, opaque, context: context4, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -10103,7 +10103,7 @@ var require_api_stream = __commonJS({ statusCode, headers, opaque, - context: context3 + context: context4 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -10295,7 +10295,7 @@ var require_api_pipeline = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -10304,10 +10304,10 @@ var require_api_pipeline = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context3 } = this; + const { opaque, handler: handler2, context: context4 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10325,7 +10325,7 @@ var require_api_pipeline = __commonJS({ headers, opaque, body: this.res, - context: context3 + context: context4 }); } catch (err) { this.res.on("error", util.nop); @@ -10409,7 +10409,7 @@ var require_api_upgrade = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; @@ -10423,7 +10423,7 @@ var require_api_upgrade = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10431,7 +10431,7 @@ var require_api_upgrade = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -10500,20 +10500,20 @@ var require_api_connect = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -10525,7 +10525,7 @@ var require_api_connect = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -21321,7 +21321,7 @@ var require_core = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; - exports2.exportVariable = exportVariable6; + exports2.exportVariable = exportVariable7; exports2.setSecret = setSecret; exports2.addPath = addPath2; exports2.getInput = getInput2; @@ -21353,7 +21353,7 @@ var require_core = __commonJS({ ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable6(name, val) { + function exportVariable7(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; @@ -24840,18 +24840,18 @@ var require_webidl2 = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context3) { - const plural = context3.types.length === 1 ? "" : " one of"; - const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context4) { + const plural = context4.types.length === 1 ? "" : " one of"; + const message = `${context4.argument} could not be converted to${plural}: ${context4.types.join(", ")}.`; return webidl.errors.exception({ - header: context3.prefix, + header: context4.prefix, message }); }; - webidl.errors.invalidArgument = function(context3) { + webidl.errors.invalidArgument = function(context4) { return webidl.errors.exception({ - header: context3.prefix, - message: `"${context3.value}" is an invalid ${context3.type}.` + header: context4.prefix, + message: `"${context4.value}" is an invalid ${context4.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -30847,17 +30847,17 @@ var require_api_request2 = __commonJS({ } } } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context4, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -30894,7 +30894,7 @@ var require_api_request2 = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context3 + context: context4 }); } } @@ -31063,17 +31063,17 @@ var require_api_stream2 = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context3, callback, responseHeaders } = this; + const { factory, opaque, context: context4, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -31101,7 +31101,7 @@ var require_api_stream2 = __commonJS({ statusCode, headers, opaque, - context: context3 + context: context4 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -31293,7 +31293,7 @@ var require_api_pipeline2 = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -31302,10 +31302,10 @@ var require_api_pipeline2 = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context3 } = this; + const { opaque, handler: handler2, context: context4 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31323,7 +31323,7 @@ var require_api_pipeline2 = __commonJS({ headers, opaque, body: this.res, - context: context3 + context: context4 }); } catch (err) { this.res.on("error", util.nop); @@ -31407,7 +31407,7 @@ var require_api_upgrade2 = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; @@ -31421,7 +31421,7 @@ var require_api_upgrade2 = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31429,7 +31429,7 @@ var require_api_upgrade2 = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -31498,20 +31498,20 @@ var require_api_connect2 = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context3) { + onConnect(abort, context4) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context3; + this.context = context4; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context3 } = this; + const { callback, opaque, context: context4 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -31523,7 +31523,7 @@ var require_api_connect2 = __commonJS({ headers, socket, opaque, - context: context3 + context: context4 }); } onError(err) { @@ -40178,8 +40178,8 @@ function isDefined(value) { function isKeyOperator(operator) { return operator === ";" || operator === "&" || operator === "?"; } -function getValues(context3, operator, key, modifier) { - var value = context3[key], result = []; +function getValues(context4, operator, key, modifier) { + var value = context4[key], result = []; if (isDefined(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); @@ -40243,7 +40243,7 @@ function parseUrl(template) { expand: expand.bind(null, template) }; } -function expand(template, context3) { +function expand(template, context4) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, @@ -40257,7 +40257,7 @@ function expand(template, context3) { } expression.split(/,/g).forEach(function(variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context3, operator, tmp[1], tmp[2] || tmp[3])); + values.push(getValues(context4, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -48898,7 +48791,7 @@ var require_internal_glob_options_helper = __commonJS({ })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOptions = getOptions; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); function getOptions(copy) { const result = { followSymbolicLinks: true, @@ -48910,23 +48803,23 @@ var require_internal_glob_options_helper = __commonJS({ if (copy) { if (typeof copy.followSymbolicLinks === "boolean") { result.followSymbolicLinks = copy.followSymbolicLinks; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + core15.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } if (typeof copy.implicitDescendants === "boolean") { result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + core15.debug(`implicitDescendants '${result.implicitDescendants}'`); } if (typeof copy.matchDirectories === "boolean") { result.matchDirectories = copy.matchDirectories; - core14.debug(`matchDirectories '${result.matchDirectories}'`); + core15.debug(`matchDirectories '${result.matchDirectories}'`); } if (typeof copy.omitBrokenSymbolicLinks === "boolean") { result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + core15.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } if (typeof copy.excludeHiddenFiles === "boolean") { result.excludeHiddenFiles = copy.excludeHiddenFiles; - core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + core15.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } return result; @@ -50554,7 +50447,7 @@ var require_internal_globber = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var fs16 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); var path17 = __importStar2(require("path")); @@ -50607,7 +50500,7 @@ var require_internal_globber = __commonJS({ } const stack = []; for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core14.debug(`Search path '${searchPath}'`); + core15.debug(`Search path '${searchPath}'`); try { yield __await2(fs16.promises.lstat(searchPath)); } catch (err) { @@ -50682,7 +50575,7 @@ var require_internal_globber = __commonJS({ } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { - core14.debug(`Broken symlink '${item.path}'`); + core15.debug(`Broken symlink '${item.path}'`); return void 0; } throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); @@ -50698,7 +50591,7 @@ var require_internal_globber = __commonJS({ traversalChain.pop(); } if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + core15.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); return void 0; } traversalChain.push(realPath); @@ -50801,7 +50694,7 @@ var require_internal_hash_files = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hashFiles = hashFiles2; var crypto3 = __importStar2(require("crypto")); - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var fs16 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); @@ -50810,7 +50703,7 @@ var require_internal_hash_files = __commonJS({ return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; - const writeDelegate = verbose ? core14.info : core14.debug; + const writeDelegate = verbose ? core15.info : core15.debug; let hasMatch = false; const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); const result = crypto3.createHash("sha256"); @@ -52201,7 +52094,7 @@ var require_cacheUtils = __commonJS({ exports2.assertDefined = assertDefined; exports2.getCacheVersion = getCacheVersion; exports2.getRuntimeToken = getRuntimeToken; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var exec = __importStar2(require_exec()); var glob2 = __importStar2(require_glob()); var io7 = __importStar2(require_io()); @@ -52252,7 +52145,7 @@ var require_cacheUtils = __commonJS({ _e = false; const file = _c; const relativeFile = path17.relative(workspace, file).replace(new RegExp(`\\${path17.sep}`, "g"), "/"); - core14.debug(`Matched: ${relativeFile}`); + core15.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); } else { @@ -52280,7 +52173,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { let versionOutput = ""; additionalArgs.push("--version"); - core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + core15.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, @@ -52291,10 +52184,10 @@ var require_cacheUtils = __commonJS({ } }); } catch (err) { - core14.debug(err.message); + core15.debug(err.message); } versionOutput = versionOutput.trim(); - core14.debug(versionOutput); + core15.debug(versionOutput); return versionOutput; }); } @@ -52302,7 +52195,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); const version = semver10.clean(versionOutput); - core14.debug(`zstd version: ${version}`); + core15.debug(`zstd version: ${version}`); if (versionOutput === "") { return constants_1.CompressionMethod.Gzip; } else { @@ -52427,14 +52320,14 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { - var context3 = {}; - for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; - context3.addInitializer = function(f) { + var context4 = {}; + for (var p in contextIn) context4[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context4.access[p] = contextIn.access[p]; + context4.addInitializer = function(f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context3); + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context4); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); @@ -53161,19 +53054,19 @@ var require_logger = __commonJS({ logger: clientLogger }; } - var context3 = createLoggerContext({ + var context4 = createLoggerContext({ logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", namespace: "typeSpecRuntime" }); - exports2.TypeSpecRuntimeLogger = context3.logger; + exports2.TypeSpecRuntimeLogger = context4.logger; function setLogLevel(logLevel) { - context3.setLogLevel(logLevel); + context4.setLogLevel(logLevel); } function getLogLevel() { - return context3.getLogLevel(); + return context4.getLogLevel(); } function createClientLogger(namespace) { - return context3.createClientLogger(namespace); + return context4.createClientLogger(namespace); } } }); @@ -53545,8 +53438,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -57419,19 +57312,19 @@ var require_commonjs2 = __commonJS({ exports2.getLogLevel = getLogLevel; exports2.createClientLogger = createClientLogger; var logger_1 = require_internal(); - var context3 = (0, logger_1.createLoggerContext)({ + var context4 = (0, logger_1.createLoggerContext)({ logLevelEnvVarName: "AZURE_LOG_LEVEL", namespace: "azure" }); - exports2.AzureLogger = context3.logger; + exports2.AzureLogger = context4.logger; function setLogLevel(level) { - context3.setLogLevel(level); + context4.setLogLevel(level); } function getLogLevel() { - return context3.getLogLevel(); + return context4.getLogLevel(); } function createClientLogger(namespace) { - return context3.createClientLogger(namespace); + return context4.createClientLogger(namespace); } } }); @@ -58032,7 +57925,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID2; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -58079,7 +57972,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID2() { @@ -58341,14 +58234,14 @@ var require_tracingContext = __commonJS({ namespace: /* @__PURE__ */ Symbol.for("@azure/core-tracing namespace") }; function createTracingContext(options = {}) { - let context3 = new TracingContextImpl(options.parentContext); + let context4 = new TracingContextImpl(options.parentContext); if (options.span) { - context3 = context3.setValue(exports2.knownContextKeys.span, options.span); + context4 = context4.setValue(exports2.knownContextKeys.span, options.span); } if (options.namespace) { - context3 = context3.setValue(exports2.knownContextKeys.namespace, options.namespace); + context4 = context4.setValue(exports2.knownContextKeys.namespace, options.namespace); } - return context3; + return context4; } var TracingContextImpl = class _TracingContextImpl { _contextMap; @@ -58486,8 +58379,8 @@ var require_tracingClient = __commonJS({ span.end(); } } - function withContext(context3, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context3, callback, ...callbackArgs); + function withContext(context4, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context4, callback, ...callbackArgs); } function parseTraceparentHeader(traceparentHeader) { return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); @@ -91958,7 +91851,7 @@ var require_uploadUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadProgress = void 0; exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors3(); var UploadProgress = class { @@ -92000,7 +91893,7 @@ var require_uploadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const uploadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core14.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); + core15.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -92057,14 +91950,14 @@ var require_uploadUtils = __commonJS({ }; try { uploadProgress.startDisplayTimer(); - core14.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + core15.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); if (response._response.status >= 400) { throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; } catch (error3) { - core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + core15.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); throw error3; } finally { uploadProgress.stopDisplayTimer(); @@ -92149,7 +92042,7 @@ var require_requestUtils = __commonJS({ exports2.retry = retry2; exports2.retryTypedResponse = retryTypedResponse; exports2.retryHttpClientResponse = retryHttpClientResponse; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var http_client_1 = require_lib(); var constants_1 = require_constants12(); function isSuccessStatusCode(statusCode) { @@ -92207,9 +92100,9 @@ var require_requestUtils = __commonJS({ isRetryable = isRetryableStatusCode(statusCode); errorMessage = `Cache service responded with ${statusCode}`; } - core14.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + core15.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); if (!isRetryable) { - core14.debug(`${name} - Error is not retryable`); + core15.debug(`${name} - Error is not retryable`); break; } yield sleep(delay2); @@ -92468,7 +92361,7 @@ var require_downloadUtils = __commonJS({ exports2.downloadCacheHttpClient = downloadCacheHttpClient; exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); @@ -92506,7 +92399,7 @@ var require_downloadUtils = __commonJS({ this.segmentIndex = this.segmentIndex + 1; this.segmentSize = segmentSize; this.receivedBytes = 0; - core14.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); + core15.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** * Sets the number of bytes received for the current segment. @@ -92540,7 +92433,7 @@ var require_downloadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core14.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + core15.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -92590,7 +92483,7 @@ var require_downloadUtils = __commonJS({ })); downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); - core14.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); + core15.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, writeStream); const contentLengthHeader = downloadResponse.message.headers["content-length"]; @@ -92601,7 +92494,7 @@ var require_downloadUtils = __commonJS({ throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { - core14.debug("Unable to validate download, no Content-Length header"); + core15.debug("Unable to validate download, no Content-Length header"); } }); } @@ -92719,7 +92612,7 @@ var require_downloadUtils = __commonJS({ const properties = yield client.getProperties(); const contentLength = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; if (contentLength < 0) { - core14.debug("Unable to determine content length, downloading file with http-client..."); + core15.debug("Unable to determine content length, downloading file with http-client..."); yield downloadCacheHttpClient(archiveLocation, archivePath); } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); @@ -92809,7 +92702,7 @@ var require_options = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadOptions = getUploadOptions; exports2.getDownloadOptions = getDownloadOptions; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -92829,9 +92722,9 @@ var require_options = __commonJS({ } result.uploadConcurrency = !isNaN(Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) ? Math.min(32, Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) : result.uploadConcurrency; result.uploadChunkSize = !isNaN(Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"])) ? Math.min(128 * 1024 * 1024, Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"]) * 1024 * 1024) : result.uploadChunkSize; - core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core14.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core14.debug(`Upload chunk size: ${result.uploadChunkSize}`); + core15.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core15.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core15.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } function getDownloadOptions(copy) { @@ -92867,12 +92760,12 @@ var require_options = __commonJS({ if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; } - core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core14.debug(`Download concurrency: ${result.downloadConcurrency}`); - core14.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core14.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core14.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core14.debug(`Lookup only: ${result.lookupOnly}`); + core15.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core15.debug(`Download concurrency: ${result.downloadConcurrency}`); + core15.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core15.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core15.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core15.debug(`Lookup only: ${result.lookupOnly}`); return result; } } @@ -92914,7 +92807,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -92986,7 +92879,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -93066,7 +92959,7 @@ var require_cacheHttpClient = __commonJS({ exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; exports2.saveCache = saveCache5; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); var fs16 = __importStar2(require("fs")); @@ -93084,7 +92977,7 @@ var require_cacheHttpClient = __commonJS({ throw new Error("Cache Service Url not found, unable to restore cache."); } const url = `${baseUrl}_apis/artifactcache/${resource}`; - core14.debug(`Resource Url: ${url}`); + core15.debug(`Resource Url: ${url}`); return url; } function createAcceptHeader(type2, apiVersion) { @@ -93112,7 +93005,7 @@ var require_cacheHttpClient = __commonJS({ return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { - if (core14.isDebug()) { + if (core15.isDebug()) { yield printCachesListForDiagnostics(keys[0], httpClient, version); } return null; @@ -93125,9 +93018,9 @@ var require_cacheHttpClient = __commonJS({ if (!cacheDownloadUrl) { throw new Error("Cache not found."); } - core14.setSecret(cacheDownloadUrl); - core14.debug(`Cache Result:`); - core14.debug(JSON.stringify(cacheResult)); + core15.setSecret(cacheDownloadUrl); + core15.debug(`Cache Result:`); + core15.debug(JSON.stringify(cacheResult)); return cacheResult; }); } @@ -93141,10 +93034,10 @@ var require_cacheHttpClient = __commonJS({ const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - core14.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + core15.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`); for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { - core14.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); + core15.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); } } } @@ -93187,7 +93080,7 @@ Other caches with similar key:`); } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { return __awaiter2(this, void 0, void 0, function* () { - core14.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); + core15.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); const additionalHeaders = { "Content-Type": "application/octet-stream", "Content-Range": getContentRange(start, end) @@ -93209,7 +93102,7 @@ Other caches with similar key:`); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); const parallelUploads = [...new Array(concurrency).keys()]; - core14.debug("Awaiting all uploads"); + core15.debug("Awaiting all uploads"); let offset = 0; try { yield Promise.all(parallelUploads.map(() => __awaiter2(this, void 0, void 0, function* () { @@ -93252,16 +93145,16 @@ Other caches with similar key:`); yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); } else { const httpClient = createHttpClient(); - core14.debug("Upload cache"); + core15.debug("Upload cache"); yield uploadFile(httpClient, cacheId, archivePath, options); - core14.debug("Commiting cache"); + core15.debug("Commiting cache"); const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); + core15.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); } - core14.info("Cache saved successfully"); + core15.info("Cache saved successfully"); } }); } @@ -98744,7 +98637,7 @@ var require_cache5 = __commonJS({ exports2.isFeatureAvailable = isFeatureAvailable; exports2.restoreCache = restoreCache5; exports2.saveCache = saveCache5; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var path17 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); @@ -98803,7 +98696,7 @@ var require_cache5 = __commonJS({ function restoreCache5(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); + core15.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); switch (cacheServiceVersion) { case "v2": @@ -98818,8 +98711,8 @@ var require_cache5 = __commonJS({ return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.debug(JSON.stringify(keys)); + core15.debug("Resolved Keys:"); + core15.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -98837,19 +98730,19 @@ var require_cache5 = __commonJS({ return void 0; } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); + core15.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } archivePath = path17.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); + core15.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core14.isDebug()) { + if (core15.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + core15.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); + core15.info("Cache restored successfully"); return cacheEntry.cacheKey; } catch (error3) { const typedError = error3; @@ -98857,16 +98750,16 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error3.message}`); + core15.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error3.message}`); + core15.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core14.debug(`Failed to delete archive: ${error3}`); + core15.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -98877,8 +98770,8 @@ var require_cache5 = __commonJS({ options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.debug(JSON.stringify(keys)); + core15.debug("Resolved Keys:"); + core15.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -98896,30 +98789,30 @@ var require_cache5 = __commonJS({ }; const response = yield twirpClient.GetCacheEntryDownloadURL(request2); if (!response.ok) { - core14.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); + core15.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); return void 0; } const isRestoreKeyMatch = request2.key !== response.matchedKey; if (isRestoreKeyMatch) { - core14.info(`Cache hit for restore-key: ${response.matchedKey}`); + core15.info(`Cache hit for restore-key: ${response.matchedKey}`); } else { - core14.info(`Cache hit for: ${response.matchedKey}`); + core15.info(`Cache hit for: ${response.matchedKey}`); } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); + core15.info("Lookup only - skipping download"); return response.matchedKey; } archivePath = path17.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive path: ${archivePath}`); - core14.debug(`Starting download of archive to: ${archivePath}`); + core15.debug(`Archive path: ${archivePath}`); + core15.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core14.isDebug()) { + core15.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core15.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); + core15.info("Cache restored successfully"); return response.matchedKey; } catch (error3) { const typedError = error3; @@ -98927,9 +98820,9 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error3.message}`); + core15.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error3.message}`); + core15.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -98938,7 +98831,7 @@ var require_cache5 = __commonJS({ yield utils.unlinkFile(archivePath); } } catch (error3) { - core14.debug(`Failed to delete archive: ${error3}`); + core15.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -98947,7 +98840,7 @@ var require_cache5 = __commonJS({ function saveCache5(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); + core15.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); checkKey(key); switch (cacheServiceVersion) { @@ -98965,26 +98858,26 @@ var require_cache5 = __commonJS({ const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core14.debug("Cache Paths:"); - core14.debug(`${JSON.stringify(cachePaths)}`); + core15.debug("Cache Paths:"); + core15.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path17.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); + core15.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { + if (core15.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const fileSizeLimit = 10 * 1024 * 1024 * 1024; const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.debug(`File Size: ${archiveFileSize}`); + core15.debug(`File Size: ${archiveFileSize}`); if (archiveFileSize > fileSizeLimit && !(0, config_1.isGhes)()) { throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); } - core14.debug("Reserving Cache"); + core15.debug("Reserving Cache"); const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { compressionMethod, enableCrossOsArchive, @@ -98997,26 +98890,26 @@ var require_cache5 = __commonJS({ } else { throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); } - core14.debug(`Saving Cache (ID: ${cacheId})`); + core15.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); } catch (error3) { const typedError = error3; if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError2.name) { - core14.info(`Failed to save: ${typedError.message}`); + core15.info(`Failed to save: ${typedError.message}`); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); + core15.error(`Failed to save: ${typedError.message}`); } else { - core14.warning(`Failed to save: ${typedError.message}`); + core15.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core14.debug(`Failed to delete archive: ${error3}`); + core15.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -99029,23 +98922,23 @@ var require_cache5 = __commonJS({ const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core14.debug("Cache Paths:"); - core14.debug(`${JSON.stringify(cachePaths)}`); + core15.debug("Cache Paths:"); + core15.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path17.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); + core15.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { + if (core15.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.debug(`File Size: ${archiveFileSize}`); + core15.debug(`File Size: ${archiveFileSize}`); options.archiveSizeBytes = archiveFileSize; - core14.debug("Reserving Cache"); + core15.debug("Reserving Cache"); const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); const request2 = { key, @@ -99056,16 +98949,16 @@ var require_cache5 = __commonJS({ const response = yield twirpClient.CreateCacheEntry(request2); if (!response.ok) { if (response.message) { - core14.warning(`Cache reservation failed: ${response.message}`); + core15.warning(`Cache reservation failed: ${response.message}`); } throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; } catch (error3) { - core14.debug(`Failed to reserve cache: ${error3}`); + core15.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - core14.debug(`Attempting to upload cache located at: ${archivePath}`); + core15.debug(`Attempting to upload cache located at: ${archivePath}`); yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options); const finalizeRequest = { key, @@ -99073,7 +98966,7 @@ var require_cache5 = __commonJS({ sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); - core14.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); + core15.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); if (!finalizeResponse.ok) { if (finalizeResponse.message) { throw new FinalizeCacheError(finalizeResponse.message); @@ -99086,21 +98979,21 @@ var require_cache5 = __commonJS({ if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError2.name) { - core14.info(`Failed to save: ${typedError.message}`); + core15.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { - core14.warning(typedError.message); + core15.warning(typedError.message); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); + core15.error(`Failed to save: ${typedError.message}`); } else { - core14.warning(`Failed to save: ${typedError.message}`); + core15.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core14.debug(`Failed to delete archive: ${error3}`); + core15.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -99327,7 +99220,7 @@ var require_retry_helper = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RetryHelper = void 0; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var RetryHelper = class { constructor(maxAttempts, minSeconds, maxSeconds) { if (maxAttempts < 1) { @@ -99350,10 +99243,10 @@ var require_retry_helper = __commonJS({ if (isRetryable && !isRetryable(err)) { throw err; } - core14.info(err.message); + core15.info(err.message); } const seconds = this.getSleepAmount(); - core14.info(`Waiting ${seconds} seconds before trying again`); + core15.info(`Waiting ${seconds} seconds before trying again`); yield this.sleep(seconds); attempt++; } @@ -99456,7 +99349,7 @@ var require_tool_cache = __commonJS({ exports2.findFromManifest = findFromManifest; exports2.isExplicitVersion = isExplicitVersion; exports2.evaluateVersions = evaluateVersions; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var io7 = __importStar2(require_io()); var crypto3 = __importStar2(require("crypto")); var fs16 = __importStar2(require("fs")); @@ -99485,8 +99378,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { dest = dest || path17.join(_getTempDirectory(), crypto3.randomUUID()); yield io7.mkdirP(path17.dirname(dest)); - core14.debug(`Downloading ${url}`); - core14.debug(`Destination ${dest}`); + core15.debug(`Downloading ${url}`); + core15.debug(`Destination ${dest}`); const maxAttempts = 3; const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); @@ -99512,7 +99405,7 @@ var require_tool_cache = __commonJS({ allowRetries: false }); if (auth2) { - core14.debug("set auth"); + core15.debug("set auth"); if (headers === void 0) { headers = {}; } @@ -99521,7 +99414,7 @@ var require_tool_cache = __commonJS({ const response = yield http.get(url, headers); if (response.message.statusCode !== 200) { const err = new HTTPError2(response.message.statusCode); - core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + core15.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } const pipeline = util.promisify(stream2.pipeline); @@ -99530,16 +99423,16 @@ var require_tool_cache = __commonJS({ let succeeded = false; try { yield pipeline(readStream, fs16.createWriteStream(dest)); - core14.debug("download complete"); + core15.debug("download complete"); succeeded = true; return dest; } finally { if (!succeeded) { - core14.debug("download failed"); + core15.debug("download failed"); try { yield io7.rmRF(dest); } catch (err) { - core14.debug(`Failed to delete '${dest}'. ${err.message}`); + core15.debug(`Failed to delete '${dest}'. ${err.message}`); } } } @@ -99554,7 +99447,7 @@ var require_tool_cache = __commonJS({ process.chdir(dest); if (_7zPath) { try { - const logLevel = core14.isDebug() ? "-bb1" : "-bb0"; + const logLevel = core15.isDebug() ? "-bb1" : "-bb0"; const args = [ "x", // eXtract files with full paths @@ -99607,7 +99500,7 @@ var require_tool_cache = __commonJS({ throw new Error("parameter 'file' is required"); } dest = yield _createExtractFolder(dest); - core14.debug("Checking tar --version"); + core15.debug("Checking tar --version"); let versionOutput = ""; yield (0, exec_1.exec)("tar --version", [], { ignoreReturnCode: true, @@ -99617,7 +99510,7 @@ var require_tool_cache = __commonJS({ stderr: (data) => versionOutput += data.toString() } }); - core14.debug(versionOutput.trim()); + core15.debug(versionOutput.trim()); const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); let args; if (flags instanceof Array) { @@ -99625,7 +99518,7 @@ var require_tool_cache = __commonJS({ } else { args = [flags]; } - if (core14.isDebug() && !flags.includes("v")) { + if (core15.isDebug() && !flags.includes("v")) { args.push("-v"); } let destArg = dest; @@ -99656,7 +99549,7 @@ var require_tool_cache = __commonJS({ args = [flags]; } args.push("-x", "-C", dest, "-f", file); - if (core14.isDebug()) { + if (core15.isDebug()) { args.push("-v"); } const xarPath = yield io7.which("xar", true); @@ -99699,7 +99592,7 @@ var require_tool_cache = __commonJS({ "-Command", pwshCommand ]; - core14.debug(`Using pwsh at path: ${pwshPath}`); + core15.debug(`Using pwsh at path: ${pwshPath}`); yield (0, exec_1.exec)(`"${pwshPath}"`, args); } else { const powershellCommand = [ @@ -99719,7 +99612,7 @@ var require_tool_cache = __commonJS({ powershellCommand ]; const powershellPath = yield io7.which("powershell", true); - core14.debug(`Using powershell at path: ${powershellPath}`); + core15.debug(`Using powershell at path: ${powershellPath}`); yield (0, exec_1.exec)(`"${powershellPath}"`, args); } }); @@ -99728,7 +99621,7 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const unzipPath = yield io7.which("unzip", true); const args = [file]; - if (!core14.isDebug()) { + if (!core15.isDebug()) { args.unshift("-q"); } args.unshift("-o"); @@ -99739,8 +99632,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver10.clean(version) || version; arch2 = arch2 || os6.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch2}`); - core14.debug(`source dir: ${sourceDir}`); + core15.debug(`Caching tool ${tool} ${version} ${arch2}`); + core15.debug(`source dir: ${sourceDir}`); if (!fs16.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } @@ -99757,14 +99650,14 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver10.clean(version) || version; arch2 = arch2 || os6.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch2}`); - core14.debug(`source file: ${sourceFile}`); + core15.debug(`Caching tool ${tool} ${version} ${arch2}`); + core15.debug(`source file: ${sourceFile}`); if (!fs16.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); const destPath = path17.join(destFolder, targetFile); - core14.debug(`destination file ${destPath}`); + core15.debug(`destination file ${destPath}`); yield io7.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); return destFolder; @@ -99787,12 +99680,12 @@ var require_tool_cache = __commonJS({ if (versionSpec) { versionSpec = semver10.clean(versionSpec) || ""; const cachePath = path17.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core14.debug(`checking cache: ${cachePath}`); + core15.debug(`checking cache: ${cachePath}`); if (fs16.existsSync(cachePath) && fs16.existsSync(`${cachePath}.complete`)) { - core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + core15.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { - core14.debug("not found"); + core15.debug("not found"); } } return toolPath; @@ -99821,7 +99714,7 @@ var require_tool_cache = __commonJS({ const http = new httpm.HttpClient("tool-cache"); const headers = {}; if (auth2) { - core14.debug("set auth"); + core15.debug("set auth"); headers.authorization = auth2; } const response = yield http.getJson(treeUrl, headers); @@ -99842,7 +99735,7 @@ var require_tool_cache = __commonJS({ try { releases = JSON.parse(versionsRaw); } catch (_a) { - core14.debug("Invalid json"); + core15.debug("Invalid json"); } } return releases; @@ -99866,7 +99759,7 @@ var require_tool_cache = __commonJS({ function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { const folderPath = path17.join(_getCacheDirectory(), tool, semver10.clean(version) || version, arch2 || ""); - core14.debug(`destination ${folderPath}`); + core15.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io7.rmRF(folderPath); yield io7.rmRF(markerPath); @@ -99878,18 +99771,18 @@ var require_tool_cache = __commonJS({ const folderPath = path17.join(_getCacheDirectory(), tool, semver10.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; fs16.writeFileSync(markerPath, ""); - core14.debug("finished caching tool"); + core15.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { const c = semver10.clean(versionSpec) || ""; - core14.debug(`isExplicit: ${c}`); + core15.debug(`isExplicit: ${c}`); const valid3 = semver10.valid(c) != null; - core14.debug(`explicit? ${valid3}`); + core15.debug(`explicit? ${valid3}`); return valid3; } function evaluateVersions(versions, versionSpec) { let version = ""; - core14.debug(`evaluating ${versions.length} versions`); + core15.debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver10.gt(a, b)) { return 1; @@ -99905,9 +99798,9 @@ var require_tool_cache = __commonJS({ } } if (version) { - core14.debug(`matched: ${version}`); + core15.debug(`matched: ${version}`); } else { - core14.debug("match not found"); + core15.debug("match not found"); } return version; } @@ -100091,7 +99984,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString3(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -100346,7 +100239,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString3(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -100362,7 +100255,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString3(options.host) && !isString3(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -100389,7 +100282,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString3(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -100461,11 +100354,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString3(subdomain) && isString3(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString3(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -100490,8 +100383,8 @@ __export(init_action_exports, { module.exports = __toCommonJS(init_action_exports); var fs15 = __toESM(require("fs")); var path16 = __toESM(require("path")); -var core13 = __toESM(require_core()); -var github2 = __toESM(require_github()); +var core14 = __toESM(require_core()); +var github3 = __toESM(require_github()); var io6 = __toESM(require_io()); var semver9 = __toESM(require_semver2()); @@ -103214,6 +103107,14 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.21"; var minimumVersion = "3.14"; +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isString(value) { + return typeof value === "string"; +} + // src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; var BROKEN_VERSIONS = ["0.0.0-20211207"]; @@ -103527,7 +103428,7 @@ var HTTPError = class extends Error { var ConfigurationError = class extends Error { }; function asHTTPError(arg) { - if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { + if (!isObject2(arg) || !isString(arg.message)) { return void 0; } if (Number.isInteger(arg.status)) { @@ -103762,7 +103663,6 @@ var Failure = class { }; // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -103779,7 +103679,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -104131,6 +104031,7 @@ function parseRepositoryNwo(input) { // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -104145,10 +104046,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -104403,19 +104301,31 @@ function getUnknownLanguagesError(languages) { } // src/feature-flags/properties.ts +var GITHUB_CODEQL_PROPERTY_PREFIX = "github-codeql-"; var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); +function isString2(value) { + return typeof value === "string"; +} +var stringProperty = { + validate: isString2, + parse: parseStringRepositoryProperty +}; +var booleanProperty = { + // The value from the API should come as a string, which we then parse into a boolean. + validate: isString2, + parse: parseBooleanRepositoryProperty +}; var repositoryPropertyParsers = { - ["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: parseBooleanRepositoryProperty, - ["github-codeql-extra-queries" /* EXTRA_QUERIES */]: parseStringRepositoryProperty + ["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: booleanProperty, + ["github-codeql-extra-queries" /* EXTRA_QUERIES */]: stringProperty, + ["github-codeql-file-coverage-on-prs" /* FILE_COVERAGE_ON_PRS */]: booleanProperty }; -async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { - if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */) { - return {}; - } +async function loadPropertiesFromApi(logger, repositoryNwo) { try { const response = await getRepositoryProperties(repositoryNwo); const remoteProperties = response.data; @@ -104428,19 +104338,17 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { `Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}` ); const properties = {}; + const unrecognisedProperties = []; for (const property of remoteProperties) { if (property.property_name === void 0) { throw new Error( `Expected repository property object to have a 'property_name', but got: ${JSON.stringify(property)}` ); } - if (typeof property.value !== "string") { - throw new Error( - `Expected repository property '${property.property_name}' to have a string value, but got: ${JSON.stringify(property)}` - ); - } if (isKnownPropertyName(property.property_name)) { setProperty2(properties, property.property_name, property.value, logger); + } else if (property.property_name.startsWith(GITHUB_CODEQL_PROPERTY_PREFIX) && !isDynamicWorkflow()) { + unrecognisedProperties.push(property.property_name); } } if (Object.keys(properties).length === 0) { @@ -104455,6 +104363,12 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { logger.debug(` ${property}: ${value}`); } } + if (unrecognisedProperties.length > 0) { + const unrecognisedPropertyList = unrecognisedProperties.map((name) => `'${name}'`).join(", "); + logger.warning( + `Found repository properties (${unrecognisedPropertyList}), which look like CodeQL Action repository properties, but which are not understood by this version of the CodeQL Action. Do you need to update to a newer version?` + ); + } return properties; } catch (e) { throw new Error( @@ -104463,7 +104377,14 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { } } function setProperty2(properties, name, value, logger) { - properties[name] = repositoryPropertyParsers[name](name, value, logger); + const propertyOptions = repositoryPropertyParsers[name]; + if (propertyOptions.validate(value)) { + properties[name] = propertyOptions.parse(name, value, logger); + } else { + throw new Error( + `Unexpected value for repository property '${name}' (${typeof value}), got: ${JSON.stringify(value)}` + ); + } } function parseBooleanRepositoryProperty(name, value, logger) { if (value !== "true" && value !== "false") { @@ -105093,6 +105014,12 @@ async function getGeneratedFiles(workingDirectory) { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -105381,70 +105308,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -105456,25 +105361,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -105484,23 +105384,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -105516,11 +105406,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -105538,11 +105425,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -106021,7 +105903,7 @@ async function getOverlayStatus(codeql, languages, diskUsage, logger) { } const contents = await fs5.promises.readFile(statusFile, "utf-8"); const parsed = JSON.parse(contents); - if (typeof parsed !== "object" || parsed === null || typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" || typeof parsed["builtOverlayBaseDatabase"] !== "boolean") { + if (!isObject2(parsed) || typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" || typeof parsed["builtOverlayBaseDatabase"] !== "boolean") { logger.debug( "Ignoring overlay status cache entry with unexpected format." ); @@ -106370,28 +106252,20 @@ async function loadUserConfig(logger, configFile, workspacePath, apiDetails, tem } } var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; async function checkOverlayAnalysisFeatureEnabled(features, codeql, languages, codeScanningConfig) { if (!await features.getValue("overlay_analysis" /* OverlayAnalysis */, codeql)) { @@ -107136,7 +107010,9 @@ var internal = { // src/init.ts var fs13 = __toESM(require("fs")); var path14 = __toESM(require("path")); +var core11 = __toESM(require_core()); var toolrunner4 = __toESM(require_toolrunner()); +var github2 = __toESM(require_github()); var io5 = __toESM(require_io()); // src/codeql.ts @@ -109080,20 +108956,82 @@ function cleanupDatabaseClusterDirectory(config, logger, options = {}, rmSync2 = } } } -async function getFileCoverageInformationEnabled(debugMode, repositoryNwo, features) { - return ( - // Always enable file coverage information in debug mode - debugMode || // We're most interested in speeding up PRs, and we want to keep - // submitting file coverage information for the default branch since - // it is used to populate the status page. - !isAnalyzingPullRequest() || // For now, restrict this feature to the GitHub org - repositoryNwo.owner !== "github" || !await features.getValue("skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */) - ); +async function getFileCoverageInformationEnabled(debugMode, codeql, features, repositoryProperties) { + if (debugMode) { + return { + enabled: true, + enabledByRepositoryProperty: false, + showDeprecationWarning: false + }; + } + if (!isAnalyzingPullRequest()) { + return { + enabled: true, + enabledByRepositoryProperty: false, + showDeprecationWarning: false + }; + } + if ((process.env["CODEQL_ACTION_FILE_COVERAGE_ON_PRS" /* FILE_COVERAGE_ON_PRS */] || "").toLocaleLowerCase() === "true") { + return { + enabled: true, + enabledByRepositoryProperty: false, + showDeprecationWarning: false + }; + } + if (repositoryProperties["github-codeql-file-coverage-on-prs" /* FILE_COVERAGE_ON_PRS */] === true) { + return { + enabled: true, + enabledByRepositoryProperty: true, + showDeprecationWarning: false + }; + } + if (!await features.getValue("skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */, codeql)) { + return { + enabled: true, + enabledByRepositoryProperty: false, + showDeprecationWarning: true + }; + } + return { + enabled: false, + enabledByRepositoryProperty: false, + showDeprecationWarning: false + }; +} +function logFileCoverageOnPrsDeprecationWarning(logger) { + if (process.env["CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION" /* DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION */]) { + return; + } + const repositoryOwnerType = github2.context.payload.repository?.owner.type; + let message = "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests to improve analysis performance. File coverage information will still be computed on non-PR analyses."; + const envVarOptOut = "set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`."; + const repoPropertyOptOut = 'create a custom repository property with the name `github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to `true` in the repository\'s settings.'; + if (repositoryOwnerType === "Organization") { + if (isDefaultSetup()) { + message += ` + +To opt out of this change, ${repoPropertyOptOut}`; + } else { + message += ` + +To opt out of this change, ${envVarOptOut} Alternatively, ${repoPropertyOptOut}`; + } + } else if (isDefaultSetup()) { + message += ` + +To opt out of this change, switch to an advanced setup workflow and ${envVarOptOut}`; + } else { + message += ` + +To opt out of this change, ${envVarOptOut}`; + } + logger.warning(message); + core11.exportVariable("CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION" /* DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION */, "true"); } // src/status-report.ts var os5 = __toESM(require("os")); -var core11 = __toESM(require_core()); +var core12 = __toESM(require_core()); function isFirstPartyAnalysis(actionName) { if (actionName !== "upload-sarif" /* UploadSarif */) { return true; @@ -109109,12 +109047,12 @@ function getActionsStatus(error3, otherFailureCause) { } function setJobStatusIfUnsuccessful(actionStatus) { if (actionStatus === "user-error") { - core11.exportVariable( + core12.exportVariable( "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */ ); } else if (actionStatus === "failure" || actionStatus === "aborted") { - core11.exportVariable( + core12.exportVariable( "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_FAILURE" /* FailureStatus */ ); @@ -109133,14 +109071,14 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi let workflowStartedAt = process.env["CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */]; if (workflowStartedAt === void 0) { workflowStartedAt = actionStartedAt.toISOString(); - core11.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); + core12.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); } const runnerOs = getRequiredEnvParam("RUNNER_OS"); const codeQlCliVersion = getCachedCodeQlVersion(); const actionRef = process.env["GITHUB_ACTION_REF"] || ""; const testingEnvironment = getTestingEnvironment(); if (testingEnvironment) { - core11.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); + core12.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); } const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true"; const statusReport = { @@ -109223,9 +109161,9 @@ var INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the API endpo async function sendStatusReport(statusReport) { setJobStatusIfUnsuccessful(statusReport.status); const statusReportJSON = JSON.stringify(statusReport); - core11.debug(`Sending status report: ${statusReportJSON}`); + core12.debug(`Sending status report: ${statusReportJSON}`); if (isInTestMode()) { - core11.debug("In test mode. Status reports are not uploaded."); + core12.debug("In test mode. Status reports are not uploaded."); return; } const nwo = getRepositoryNwo(); @@ -109245,28 +109183,28 @@ async function sendStatusReport(statusReport) { switch (httpError.status) { case 403: if (getWorkflowEventName() === "push" && process.env["GITHUB_ACTOR"] === "dependabot[bot]") { - core11.warning( + core12.warning( `Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading CodeQL results requires write access. To use CodeQL with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push" /* SCANNING_ON_PUSH */} for more information on how to configure these events.` ); } else { - core11.warning( + core12.warning( `This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. This could be because the Action is running on a pull request from a fork. If not, please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}` ); } return; case 404: - core11.warning(httpError.message); + core12.warning(httpError.message); return; case 422: if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) { - core11.debug(INCOMPATIBLE_MSG); + core12.debug(INCOMPATIBLE_MSG); } else { - core11.debug(OUT_OF_DATE_MSG); + core12.debug(OUT_OF_DATE_MSG); } return; } } - core11.warning( + core12.warning( `An unexpected error occurred when sending a status report: ${getErrorMessage( e )}` @@ -109348,7 +109286,7 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error var fs14 = __toESM(require("fs")); var path15 = __toESM(require("path")); var import_zlib = __toESM(require("zlib")); -var core12 = __toESM(require_core()); +var core13 = __toESM(require_core()); function toCodedErrors(errors) { return Object.entries(errors).reduce( (acc, [code, message]) => { @@ -109471,7 +109409,7 @@ async function validateWorkflow(codeql, logger) { } catch (e) { return `error: formatWorkflowErrors() failed: ${String(e)}`; } - core12.warning(message); + core13.warning(message); } return formatWorkflowCause(workflowErrors); } @@ -109517,7 +109455,7 @@ async function getWorkflowAbsolutePath(logger) { } async function checkWorkflow(logger, codeql) { if (!isDynamicWorkflow() && process.env["CODEQL_ACTION_SKIP_WORKFLOW_VALIDATION" /* SKIP_WORKFLOW_VALIDATION */] !== "true") { - core12.startGroup("Validating workflow"); + core13.startGroup("Validating workflow"); const validateWorkflowResult = await internal2.validateWorkflow( codeql, logger @@ -109529,7 +109467,7 @@ async function checkWorkflow(logger, codeql) { `Unable to validate code scanning workflow: ${validateWorkflowResult}` ); } - core12.endGroup(); + core13.endGroup(); } } var internal2 = { @@ -109633,14 +109571,12 @@ async function run(startedAt) { ); const repositoryPropertiesResult = await loadRepositoryProperties( repositoryNwo, - gitHubVersion, - features, logger ); const jobRunUuid = v4_default(); logger.info(`Job run UUID is ${jobRunUuid}.`); - core13.exportVariable("JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); - core13.exportVariable("CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */, "true"); + core14.exportVariable("JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); + core14.exportVariable("CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */, "true"); configFile = getOptionalInput("config-file"); sourceRoot = path16.resolve( getRequiredEnvParam("GITHUB_WORKSPACE"), @@ -109693,12 +109629,19 @@ async function run(startedAt) { ); } if (semver9.lt(actualVer, publicPreview)) { - core13.exportVariable("CODEQL_ENABLE_EXPERIMENTAL_FEATURES" /* EXPERIMENTAL_FEATURES */, "true"); + core14.exportVariable("CODEQL_ENABLE_EXPERIMENTAL_FEATURES" /* EXPERIMENTAL_FEATURES */, "true"); logger.info("Experimental Rust analysis enabled"); } } analysisKinds = await getAnalysisKinds(logger); - const debugMode = getOptionalInput("debug") === "true" || core13.isDebug(); + const debugMode = getOptionalInput("debug") === "true" || core14.isDebug(); + const repositoryProperties = repositoryPropertiesResult.orElse({}); + const fileCoverageResult = await getFileCoverageInformationEnabled( + debugMode, + codeql, + features, + repositoryProperties + ); config = await initConfig2(features, { analysisKinds, languagesInput: getOptionalInput("languages"), @@ -109726,12 +109669,8 @@ async function run(startedAt) { githubVersion: gitHubVersion, apiDetails, features, - repositoryProperties: repositoryPropertiesResult.orElse({}), - enableFileCoverageInformation: await getFileCoverageInformationEnabled( - debugMode, - repositoryNwo, - features - ), + repositoryProperties, + enableFileCoverageInformation: fileCoverageResult.enabled, logger }); if (repositoryPropertiesResult.isFailure()) { @@ -109746,10 +109685,23 @@ async function run(startedAt) { ) ); } + if (fileCoverageResult.enabledByRepositoryProperty) { + addNoLanguageDiagnostic( + config, + makeTelemetryDiagnostic( + "codeql-action/file-coverage-on-prs-enabled-by-repository-property", + "File coverage on PRs enabled by repository property", + {} + ) + ); + } + if (fileCoverageResult.showDeprecationWarning) { + logFileCoverageOnPrsDeprecationWarning(logger); + } await checkInstallPython311(config.languages, codeql); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); - core13.setFailed(error3.message); + core14.setFailed(error3.message); const statusReportBase = await createStatusReportBase( "init" /* Init */, error3 instanceof ConfigurationError ? "user-error" : "aborted", @@ -109799,8 +109751,8 @@ async function run(startedAt) { } const goFlags = process.env["GOFLAGS"]; if (goFlags) { - core13.exportVariable("GOFLAGS", goFlags); - core13.warning( + core14.exportVariable("GOFLAGS", goFlags); + core14.warning( "Passing the GOFLAGS env parameter to the init action is deprecated. Please move this to the analyze action." ); } @@ -109824,7 +109776,7 @@ async function run(startedAt) { "bin" ); fs15.mkdirSync(tempBinPath, { recursive: true }); - core13.addPath(tempBinPath); + core14.addPath(tempBinPath); const goWrapperPath = path16.resolve(tempBinPath, "go"); fs15.writeFileSync( goWrapperPath, @@ -109833,14 +109785,14 @@ async function run(startedAt) { exec ${goBinaryPath} "$@"` ); fs15.chmodSync(goWrapperPath, "755"); - core13.exportVariable("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goWrapperPath); + core14.exportVariable("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goWrapperPath); } catch (e) { logger.warning( `Analyzing Go on Linux, but failed to install wrapper script. Tracing custom builds may fail: ${e}` ); } } else { - core13.exportVariable("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goBinaryPath); + core14.exportVariable("CODEQL_ACTION_GO_BINARY" /* GO_BINARY_LOCATION */, goBinaryPath); } } catch (e) { logger.warning( @@ -109867,20 +109819,20 @@ exec ${goBinaryPath} "$@"` } } } - core13.exportVariable( + core14.exportVariable( "CODEQL_RAM", process.env["CODEQL_RAM"] || getCodeQLMemoryLimit(getOptionalInput("ram"), logger).toString() ); - core13.exportVariable( + core14.exportVariable( "CODEQL_THREADS", process.env["CODEQL_THREADS"] || getThreadsFlagValue(getOptionalInput("threads"), logger).toString() ); if (await features.getValue("disable_kotlin_analysis_enabled" /* DisableKotlinAnalysisEnabled */)) { - core13.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true"); + core14.exportVariable("CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN", "true"); } const kotlinLimitVar = "CODEQL_EXTRACTOR_KOTLIN_OVERRIDE_MAXIMUM_VERSION_LIMIT"; if (await codeQlVersionAtLeast(codeql, "2.20.3") && !await codeQlVersionAtLeast(codeql, "2.20.4")) { - core13.exportVariable(kotlinLimitVar, "2.1.20"); + core14.exportVariable(kotlinLimitVar, "2.1.20"); } if (config.languages.includes("cpp" /* cpp */)) { const envVar = "CODEQL_EXTRACTOR_CPP_TRAP_CACHING"; @@ -109890,10 +109842,10 @@ exec ${goBinaryPath} "$@"` ); } else if (getTrapCachingEnabled() && await codeQlVersionAtLeast(codeql, "2.17.5")) { logger.info("Enabling CodeQL C++ TRAP caching support"); - core13.exportVariable(envVar, "true"); + core14.exportVariable(envVar, "true"); } else { logger.info("Disabling CodeQL C++ TRAP caching support"); - core13.exportVariable(envVar, "false"); + core14.exportVariable(envVar, "false"); } } if (shouldRestoreCache(config.dependencyCachingEnabled)) { @@ -109908,7 +109860,7 @@ exec ${goBinaryPath} "$@"` } if (await codeQlVersionAtLeast(codeql, "2.17.1")) { } else { - core13.exportVariable( + core14.exportVariable( "CODEQL_EXTRACTOR_PYTHON_DISABLE_LIBRARY_EXTRACTION", "true" ); @@ -109934,7 +109886,7 @@ exec ${goBinaryPath} "$@"` "python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */, codeql )) { - core13.exportVariable("CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB", "true"); + core14.exportVariable("CODEQL_EXTRACTOR_PYTHON_EXTRACT_STDLIB", "true"); } } if (process.env["CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */]) { @@ -109942,7 +109894,7 @@ exec ${goBinaryPath} "$@"` `${"CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */} is already set to '${process.env["CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */]}', so the Action will not override it.` ); } else if (await codeQlVersionAtLeast(codeql, CODEQL_VERSION_JAR_MINIMIZATION) && config.dependencyCachingEnabled && config.buildMode === "none" /* None */ && config.languages.includes("java" /* java */)) { - core13.exportVariable( + core14.exportVariable( "CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */, "true" ); @@ -109986,23 +109938,23 @@ exec ${goBinaryPath} "$@"` const tracerConfig = await getCombinedTracerConfig(codeql, config); if (tracerConfig !== void 0) { for (const [key, value] of Object.entries(tracerConfig.env)) { - core13.exportVariable(key, value); + core14.exportVariable(key, value); } } if (await features.getValue("java_network_debugging" /* JavaNetworkDebugging */)) { const existingJavaToolOptions = getOptionalEnvVar("JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */) || ""; - core13.exportVariable( + core14.exportVariable( "JAVA_TOOL_OPTIONS" /* JAVA_TOOL_OPTIONS */, `${existingJavaToolOptions} -Djavax.net.debug=all` ); } flushDiagnostics(config); await saveConfig(config, logger); - core13.setOutput("codeql-path", config.codeQLCmd); - core13.setOutput("codeql-version", (await codeql.getVersion()).version); + core14.setOutput("codeql-path", config.codeQLCmd); + core14.setOutput("codeql-version", (await codeql.getVersion()).version); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); - core13.setFailed(error3.message); + core14.setFailed(error3.message); await sendCompletedStatusReport( startedAt, config, @@ -110034,8 +109986,8 @@ exec ${goBinaryPath} "$@"` logger ); } -async function loadRepositoryProperties(repositoryNwo, gitHubVersion, features, logger) { - const repositoryOwnerType = github2.context.payload.repository?.owner.type; +async function loadRepositoryProperties(repositoryNwo, logger) { + const repositoryOwnerType = github3.context.payload.repository?.owner.type; logger.debug( `Repository owner type is '${repositoryOwnerType ?? "unknown"}'.` ); @@ -110045,16 +109997,8 @@ async function loadRepositoryProperties(repositoryNwo, gitHubVersion, features, ); return new Success({}); } - if (!await features.getValue("use_repository_properties_v2" /* UseRepositoryProperties */)) { - logger.debug( - "Skipping loading repository properties because the UseRepositoryProperties feature flag is disabled." - ); - return new Success({}); - } try { - return new Success( - await loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) - ); + return new Success(await loadPropertiesFromApi(logger, repositoryNwo)); } catch (error3) { logger.warning( `Failed to load repository properties: ${getErrorMessage(error3)}` @@ -110084,7 +110028,7 @@ async function runWrapper() { try { await run(startedAt); } catch (error3) { - core13.setFailed(`init action failed: ${getErrorMessage(error3)}`); + core14.setFailed(`init action failed: ${getErrorMessage(error3)}`); await sendUnhandledErrorStatusReport( "init" /* Init */, startedAt, diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 736173493c..da48d84049 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -53394,8 +53287,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -57881,7 +57774,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -57928,7 +57821,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID() { @@ -92763,7 +92656,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -92835,7 +92728,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -99940,7 +99833,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -100195,7 +100088,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -100211,7 +100104,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -100238,7 +100131,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -100310,11 +100203,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -102995,6 +102888,14 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.21"; var minimumVersion = "3.14"; +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isString(value) { + return typeof value === "string"; +} + // src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; var GITHUB_DOTCOM_URL = "https://github.com"; @@ -103095,7 +102996,7 @@ var HTTPError = class extends Error { var ConfigurationError = class extends Error { }; function asHTTPError(arg) { - if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { + if (!isObject2(arg) || !isString(arg.message)) { return void 0; } if (Number.isInteger(arg.status)) { @@ -103208,7 +103109,6 @@ async function asyncSome(array, predicate) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -103225,7 +103125,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -103431,6 +103331,7 @@ function parseRepositoryNwo(input) { // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -103445,10 +103346,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -103785,6 +103683,7 @@ var semver2 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -103988,6 +103887,12 @@ async function isAnalyzingDefaultBranch() { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -104126,70 +104031,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -104201,25 +104084,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -104229,23 +104107,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -104261,11 +104129,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -104283,11 +104148,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -104308,28 +104168,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; function getPathToParsedConfigFile(tempDir) { return path3.join(tempDir, "config"); diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 3c1adfbbdb..70871fe81f 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -3842,18 +3842,18 @@ var require_webidl = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context2) { - const plural = context2.types.length === 1 ? "" : " one of"; - const message = `${context2.argument} could not be converted to${plural}: ${context2.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; return webidl.errors.exception({ - header: context2.prefix, + header: context3.prefix, message }); }; - webidl.errors.invalidArgument = function(context2) { + webidl.errors.invalidArgument = function(context3) { return webidl.errors.exception({ - header: context2.prefix, - message: `"${context2.value}" is an invalid ${context2.type}.` + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -9849,17 +9849,17 @@ var require_api_request = __commonJS({ } } } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -9896,7 +9896,7 @@ var require_api_request = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context2 + context: context3 }); } } @@ -10065,17 +10065,17 @@ var require_api_stream = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context2, callback, responseHeaders } = this; + const { factory, opaque, context: context3, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -10103,7 +10103,7 @@ var require_api_stream = __commonJS({ statusCode, headers, opaque, - context: context2 + context: context3 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -10295,7 +10295,7 @@ var require_api_pipeline = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -10304,10 +10304,10 @@ var require_api_pipeline = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context2 } = this; + const { opaque, handler: handler2, context: context3 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10325,7 +10325,7 @@ var require_api_pipeline = __commonJS({ headers, opaque, body: this.res, - context: context2 + context: context3 }); } catch (err) { this.res.on("error", util.nop); @@ -10409,7 +10409,7 @@ var require_api_upgrade = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; @@ -10423,7 +10423,7 @@ var require_api_upgrade = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10431,7 +10431,7 @@ var require_api_upgrade = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -10500,20 +10500,20 @@ var require_api_connect = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -10525,7 +10525,7 @@ var require_api_connect = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -21321,7 +21321,7 @@ var require_core = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; - exports2.exportVariable = exportVariable6; + exports2.exportVariable = exportVariable7; exports2.setSecret = setSecret; exports2.addPath = addPath; exports2.getInput = getInput2; @@ -21353,7 +21353,7 @@ var require_core = __commonJS({ ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable6(name, val) { + function exportVariable7(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; @@ -24840,18 +24840,18 @@ var require_webidl2 = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context2) { - const plural = context2.types.length === 1 ? "" : " one of"; - const message = `${context2.argument} could not be converted to${plural}: ${context2.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; return webidl.errors.exception({ - header: context2.prefix, + header: context3.prefix, message }); }; - webidl.errors.invalidArgument = function(context2) { + webidl.errors.invalidArgument = function(context3) { return webidl.errors.exception({ - header: context2.prefix, - message: `"${context2.value}" is an invalid ${context2.type}.` + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -30847,17 +30847,17 @@ var require_api_request2 = __commonJS({ } } } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -30894,7 +30894,7 @@ var require_api_request2 = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context2 + context: context3 }); } } @@ -31063,17 +31063,17 @@ var require_api_stream2 = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context2, callback, responseHeaders } = this; + const { factory, opaque, context: context3, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -31101,7 +31101,7 @@ var require_api_stream2 = __commonJS({ statusCode, headers, opaque, - context: context2 + context: context3 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -31293,7 +31293,7 @@ var require_api_pipeline2 = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -31302,10 +31302,10 @@ var require_api_pipeline2 = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context2 } = this; + const { opaque, handler: handler2, context: context3 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31323,7 +31323,7 @@ var require_api_pipeline2 = __commonJS({ headers, opaque, body: this.res, - context: context2 + context: context3 }); } catch (err) { this.res.on("error", util.nop); @@ -31407,7 +31407,7 @@ var require_api_upgrade2 = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; @@ -31421,7 +31421,7 @@ var require_api_upgrade2 = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31429,7 +31429,7 @@ var require_api_upgrade2 = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -31498,20 +31498,20 @@ var require_api_connect2 = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -31523,7 +31523,7 @@ var require_api_connect2 = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -40178,8 +40178,8 @@ function isDefined(value) { function isKeyOperator(operator) { return operator === ";" || operator === "&" || operator === "?"; } -function getValues(context2, operator, key, modifier) { - var value = context2[key], result = []; +function getValues(context3, operator, key, modifier) { + var value = context3[key], result = []; if (isDefined(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); @@ -40243,7 +40243,7 @@ function parseUrl(template) { expand: expand.bind(null, template) }; } -function expand(template, context2) { +function expand(template, context3) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, @@ -40257,7 +40257,7 @@ function expand(template, context2) { } expression.split(/,/g).forEach(function(variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context2, operator, tmp[1], tmp[2] || tmp[3])); + values.push(getValues(context3, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -47450,7 +47343,7 @@ var require_internal_glob_options_helper = __commonJS({ })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOptions = getOptions; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); function getOptions(copy) { const result = { followSymbolicLinks: true, @@ -47462,23 +47355,23 @@ var require_internal_glob_options_helper = __commonJS({ if (copy) { if (typeof copy.followSymbolicLinks === "boolean") { result.followSymbolicLinks = copy.followSymbolicLinks; - core13.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } if (typeof copy.implicitDescendants === "boolean") { result.implicitDescendants = copy.implicitDescendants; - core13.debug(`implicitDescendants '${result.implicitDescendants}'`); + core14.debug(`implicitDescendants '${result.implicitDescendants}'`); } if (typeof copy.matchDirectories === "boolean") { result.matchDirectories = copy.matchDirectories; - core13.debug(`matchDirectories '${result.matchDirectories}'`); + core14.debug(`matchDirectories '${result.matchDirectories}'`); } if (typeof copy.omitBrokenSymbolicLinks === "boolean") { result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core13.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } if (typeof copy.excludeHiddenFiles === "boolean") { result.excludeHiddenFiles = copy.excludeHiddenFiles; - core13.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } return result; @@ -49106,7 +48999,7 @@ var require_internal_globber = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var fs9 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); var path9 = __importStar2(require("path")); @@ -49159,7 +49052,7 @@ var require_internal_globber = __commonJS({ } const stack = []; for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core13.debug(`Search path '${searchPath}'`); + core14.debug(`Search path '${searchPath}'`); try { yield __await2(fs9.promises.lstat(searchPath)); } catch (err) { @@ -49234,7 +49127,7 @@ var require_internal_globber = __commonJS({ } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { - core13.debug(`Broken symlink '${item.path}'`); + core14.debug(`Broken symlink '${item.path}'`); return void 0; } throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); @@ -49250,7 +49143,7 @@ var require_internal_globber = __commonJS({ traversalChain.pop(); } if (traversalChain.some((x) => x === realPath)) { - core13.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); return void 0; } traversalChain.push(realPath); @@ -49353,7 +49246,7 @@ var require_internal_hash_files = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hashFiles = hashFiles; var crypto2 = __importStar2(require("crypto")); - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var fs9 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); @@ -49362,7 +49255,7 @@ var require_internal_hash_files = __commonJS({ return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; - const writeDelegate = verbose ? core13.info : core13.debug; + const writeDelegate = verbose ? core14.info : core14.debug; let hasMatch = false; const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); const result = crypto2.createHash("sha256"); @@ -50753,7 +50646,7 @@ var require_cacheUtils = __commonJS({ exports2.assertDefined = assertDefined; exports2.getCacheVersion = getCacheVersion; exports2.getRuntimeToken = getRuntimeToken; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var exec = __importStar2(require_exec()); var glob = __importStar2(require_glob()); var io6 = __importStar2(require_io()); @@ -50804,7 +50697,7 @@ var require_cacheUtils = __commonJS({ _e = false; const file = _c; const relativeFile = path9.relative(workspace, file).replace(new RegExp(`\\${path9.sep}`, "g"), "/"); - core13.debug(`Matched: ${relativeFile}`); + core14.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); } else { @@ -50832,7 +50725,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { let versionOutput = ""; additionalArgs.push("--version"); - core13.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, @@ -50843,10 +50736,10 @@ var require_cacheUtils = __commonJS({ } }); } catch (err) { - core13.debug(err.message); + core14.debug(err.message); } versionOutput = versionOutput.trim(); - core13.debug(versionOutput); + core14.debug(versionOutput); return versionOutput; }); } @@ -50854,7 +50747,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); const version = semver9.clean(versionOutput); - core13.debug(`zstd version: ${version}`); + core14.debug(`zstd version: ${version}`); if (versionOutput === "") { return constants_1.CompressionMethod.Gzip; } else { @@ -50979,14 +50872,14 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { + var context3 = {}; + for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; + context3.addInitializer = function(f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context3); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); @@ -51713,19 +51606,19 @@ var require_logger = __commonJS({ logger: clientLogger }; } - var context2 = createLoggerContext({ + var context3 = createLoggerContext({ logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", namespace: "typeSpecRuntime" }); - exports2.TypeSpecRuntimeLogger = context2.logger; + exports2.TypeSpecRuntimeLogger = context3.logger; function setLogLevel(logLevel) { - context2.setLogLevel(logLevel); + context3.setLogLevel(logLevel); } function getLogLevel() { - return context2.getLogLevel(); + return context3.getLogLevel(); } function createClientLogger(namespace) { - return context2.createClientLogger(namespace); + return context3.createClientLogger(namespace); } } }); @@ -52097,8 +51990,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -55971,19 +55864,19 @@ var require_commonjs2 = __commonJS({ exports2.getLogLevel = getLogLevel; exports2.createClientLogger = createClientLogger; var logger_1 = require_internal(); - var context2 = (0, logger_1.createLoggerContext)({ + var context3 = (0, logger_1.createLoggerContext)({ logLevelEnvVarName: "AZURE_LOG_LEVEL", namespace: "azure" }); - exports2.AzureLogger = context2.logger; + exports2.AzureLogger = context3.logger; function setLogLevel(level) { - context2.setLogLevel(level); + context3.setLogLevel(level); } function getLogLevel() { - return context2.getLogLevel(); + return context3.getLogLevel(); } function createClientLogger(namespace) { - return context2.createClientLogger(namespace); + return context3.createClientLogger(namespace); } } }); @@ -56584,7 +56477,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID2; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -56631,7 +56524,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID2() { @@ -56893,14 +56786,14 @@ var require_tracingContext = __commonJS({ namespace: /* @__PURE__ */ Symbol.for("@azure/core-tracing namespace") }; function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); + let context3 = new TracingContextImpl(options.parentContext); if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + context3 = context3.setValue(exports2.knownContextKeys.span, options.span); } if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + context3 = context3.setValue(exports2.knownContextKeys.namespace, options.namespace); } - return context2; + return context3; } var TracingContextImpl = class _TracingContextImpl { _contextMap; @@ -57038,8 +56931,8 @@ var require_tracingClient = __commonJS({ span.end(); } } - function withContext(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); + function withContext(context3, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context3, callback, ...callbackArgs); } function parseTraceparentHeader(traceparentHeader) { return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); @@ -90510,7 +90403,7 @@ var require_uploadUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadProgress = void 0; exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors3(); var UploadProgress = class { @@ -90552,7 +90445,7 @@ var require_uploadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const uploadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core13.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); + core14.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -90609,14 +90502,14 @@ var require_uploadUtils = __commonJS({ }; try { uploadProgress.startDisplayTimer(); - core13.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + core14.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); if (response._response.status >= 400) { throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; } catch (error3) { - core13.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); throw error3; } finally { uploadProgress.stopDisplayTimer(); @@ -90701,7 +90594,7 @@ var require_requestUtils = __commonJS({ exports2.retry = retry2; exports2.retryTypedResponse = retryTypedResponse; exports2.retryHttpClientResponse = retryHttpClientResponse; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var http_client_1 = require_lib(); var constants_1 = require_constants12(); function isSuccessStatusCode(statusCode) { @@ -90759,9 +90652,9 @@ var require_requestUtils = __commonJS({ isRetryable = isRetryableStatusCode(statusCode); errorMessage = `Cache service responded with ${statusCode}`; } - core13.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + core14.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); if (!isRetryable) { - core13.debug(`${name} - Error is not retryable`); + core14.debug(`${name} - Error is not retryable`); break; } yield sleep(delay2); @@ -91020,7 +90913,7 @@ var require_downloadUtils = __commonJS({ exports2.downloadCacheHttpClient = downloadCacheHttpClient; exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); @@ -91058,7 +90951,7 @@ var require_downloadUtils = __commonJS({ this.segmentIndex = this.segmentIndex + 1; this.segmentSize = segmentSize; this.receivedBytes = 0; - core13.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); + core14.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** * Sets the number of bytes received for the current segment. @@ -91092,7 +90985,7 @@ var require_downloadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core13.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + core14.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -91142,7 +91035,7 @@ var require_downloadUtils = __commonJS({ })); downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); - core13.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); + core14.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, writeStream); const contentLengthHeader = downloadResponse.message.headers["content-length"]; @@ -91153,7 +91046,7 @@ var require_downloadUtils = __commonJS({ throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { - core13.debug("Unable to validate download, no Content-Length header"); + core14.debug("Unable to validate download, no Content-Length header"); } }); } @@ -91271,7 +91164,7 @@ var require_downloadUtils = __commonJS({ const properties = yield client.getProperties(); const contentLength = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; if (contentLength < 0) { - core13.debug("Unable to determine content length, downloading file with http-client..."); + core14.debug("Unable to determine content length, downloading file with http-client..."); yield downloadCacheHttpClient(archiveLocation, archivePath); } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); @@ -91361,7 +91254,7 @@ var require_options = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadOptions = getUploadOptions; exports2.getDownloadOptions = getDownloadOptions; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -91381,9 +91274,9 @@ var require_options = __commonJS({ } result.uploadConcurrency = !isNaN(Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) ? Math.min(32, Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) : result.uploadConcurrency; result.uploadChunkSize = !isNaN(Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"])) ? Math.min(128 * 1024 * 1024, Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"]) * 1024 * 1024) : result.uploadChunkSize; - core13.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core13.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core13.debug(`Upload chunk size: ${result.uploadChunkSize}`); + core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core14.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core14.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } function getDownloadOptions(copy) { @@ -91419,12 +91312,12 @@ var require_options = __commonJS({ if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; } - core13.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core13.debug(`Download concurrency: ${result.downloadConcurrency}`); - core13.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core13.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core13.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core13.debug(`Lookup only: ${result.lookupOnly}`); + core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core14.debug(`Download concurrency: ${result.downloadConcurrency}`); + core14.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core14.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core14.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core14.debug(`Lookup only: ${result.lookupOnly}`); return result; } } @@ -91466,7 +91359,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -91538,7 +91431,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -91618,7 +91511,7 @@ var require_cacheHttpClient = __commonJS({ exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; exports2.saveCache = saveCache4; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); var fs9 = __importStar2(require("fs")); @@ -91636,7 +91529,7 @@ var require_cacheHttpClient = __commonJS({ throw new Error("Cache Service Url not found, unable to restore cache."); } const url = `${baseUrl}_apis/artifactcache/${resource}`; - core13.debug(`Resource Url: ${url}`); + core14.debug(`Resource Url: ${url}`); return url; } function createAcceptHeader(type2, apiVersion) { @@ -91664,7 +91557,7 @@ var require_cacheHttpClient = __commonJS({ return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { - if (core13.isDebug()) { + if (core14.isDebug()) { yield printCachesListForDiagnostics(keys[0], httpClient, version); } return null; @@ -91677,9 +91570,9 @@ var require_cacheHttpClient = __commonJS({ if (!cacheDownloadUrl) { throw new Error("Cache not found."); } - core13.setSecret(cacheDownloadUrl); - core13.debug(`Cache Result:`); - core13.debug(JSON.stringify(cacheResult)); + core14.setSecret(cacheDownloadUrl); + core14.debug(`Cache Result:`); + core14.debug(JSON.stringify(cacheResult)); return cacheResult; }); } @@ -91693,10 +91586,10 @@ var require_cacheHttpClient = __commonJS({ const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - core13.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + core14.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`); for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { - core13.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); + core14.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); } } } @@ -91739,7 +91632,7 @@ Other caches with similar key:`); } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { return __awaiter2(this, void 0, void 0, function* () { - core13.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); + core14.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); const additionalHeaders = { "Content-Type": "application/octet-stream", "Content-Range": getContentRange(start, end) @@ -91761,7 +91654,7 @@ Other caches with similar key:`); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); const parallelUploads = [...new Array(concurrency).keys()]; - core13.debug("Awaiting all uploads"); + core14.debug("Awaiting all uploads"); let offset = 0; try { yield Promise.all(parallelUploads.map(() => __awaiter2(this, void 0, void 0, function* () { @@ -91804,16 +91697,16 @@ Other caches with similar key:`); yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); } else { const httpClient = createHttpClient(); - core13.debug("Upload cache"); + core14.debug("Upload cache"); yield uploadFile(httpClient, cacheId, archivePath, options); - core13.debug("Commiting cache"); + core14.debug("Commiting cache"); const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); + core14.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); } - core13.info("Cache saved successfully"); + core14.info("Cache saved successfully"); } }); } @@ -97296,7 +97189,7 @@ var require_cache5 = __commonJS({ exports2.isFeatureAvailable = isFeatureAvailable; exports2.restoreCache = restoreCache4; exports2.saveCache = saveCache4; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var path9 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); @@ -97355,7 +97248,7 @@ var require_cache5 = __commonJS({ function restoreCache4(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core13.debug(`Cache service version: ${cacheServiceVersion}`); + core14.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); switch (cacheServiceVersion) { case "v2": @@ -97370,8 +97263,8 @@ var require_cache5 = __commonJS({ return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core13.debug("Resolved Keys:"); - core13.debug(JSON.stringify(keys)); + core14.debug("Resolved Keys:"); + core14.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -97389,19 +97282,19 @@ var require_cache5 = __commonJS({ return void 0; } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core13.info("Lookup only - skipping download"); + core14.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } archivePath = path9.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive Path: ${archivePath}`); + core14.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core13.isDebug()) { + if (core14.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core13.info("Cache restored successfully"); + core14.info("Cache restored successfully"); return cacheEntry.cacheKey; } catch (error3) { const typedError = error3; @@ -97409,16 +97302,16 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to restore: ${error3.message}`); + core14.error(`Failed to restore: ${error3.message}`); } else { - core13.warning(`Failed to restore: ${error3.message}`); + core14.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core13.debug(`Failed to delete archive: ${error3}`); + core14.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -97429,8 +97322,8 @@ var require_cache5 = __commonJS({ options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core13.debug("Resolved Keys:"); - core13.debug(JSON.stringify(keys)); + core14.debug("Resolved Keys:"); + core14.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -97448,30 +97341,30 @@ var require_cache5 = __commonJS({ }; const response = yield twirpClient.GetCacheEntryDownloadURL(request2); if (!response.ok) { - core13.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); + core14.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); return void 0; } const isRestoreKeyMatch = request2.key !== response.matchedKey; if (isRestoreKeyMatch) { - core13.info(`Cache hit for restore-key: ${response.matchedKey}`); + core14.info(`Cache hit for restore-key: ${response.matchedKey}`); } else { - core13.info(`Cache hit for: ${response.matchedKey}`); + core14.info(`Cache hit for: ${response.matchedKey}`); } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core13.info("Lookup only - skipping download"); + core14.info("Lookup only - skipping download"); return response.matchedKey; } archivePath = path9.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive path: ${archivePath}`); - core13.debug(`Starting download of archive to: ${archivePath}`); + core14.debug(`Archive path: ${archivePath}`); + core14.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core13.isDebug()) { + core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core14.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core13.info("Cache restored successfully"); + core14.info("Cache restored successfully"); return response.matchedKey; } catch (error3) { const typedError = error3; @@ -97479,9 +97372,9 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to restore: ${error3.message}`); + core14.error(`Failed to restore: ${error3.message}`); } else { - core13.warning(`Failed to restore: ${error3.message}`); + core14.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -97490,7 +97383,7 @@ var require_cache5 = __commonJS({ yield utils.unlinkFile(archivePath); } } catch (error3) { - core13.debug(`Failed to delete archive: ${error3}`); + core14.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -97499,7 +97392,7 @@ var require_cache5 = __commonJS({ function saveCache4(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core13.debug(`Cache service version: ${cacheServiceVersion}`); + core14.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); checkKey(key); switch (cacheServiceVersion) { @@ -97517,26 +97410,26 @@ var require_cache5 = __commonJS({ const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core13.debug("Cache Paths:"); - core13.debug(`${JSON.stringify(cachePaths)}`); + core14.debug("Cache Paths:"); + core14.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path9.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive Path: ${archivePath}`); + core14.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core13.isDebug()) { + if (core14.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const fileSizeLimit = 10 * 1024 * 1024 * 1024; const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.debug(`File Size: ${archiveFileSize}`); + core14.debug(`File Size: ${archiveFileSize}`); if (archiveFileSize > fileSizeLimit && !(0, config_1.isGhes)()) { throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); } - core13.debug("Reserving Cache"); + core14.debug("Reserving Cache"); const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { compressionMethod, enableCrossOsArchive, @@ -97549,26 +97442,26 @@ var require_cache5 = __commonJS({ } else { throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); } - core13.debug(`Saving Cache (ID: ${cacheId})`); + core14.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); } catch (error3) { const typedError = error3; if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError.name) { - core13.info(`Failed to save: ${typedError.message}`); + core14.info(`Failed to save: ${typedError.message}`); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to save: ${typedError.message}`); + core14.error(`Failed to save: ${typedError.message}`); } else { - core13.warning(`Failed to save: ${typedError.message}`); + core14.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core13.debug(`Failed to delete archive: ${error3}`); + core14.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -97581,23 +97474,23 @@ var require_cache5 = __commonJS({ const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core13.debug("Cache Paths:"); - core13.debug(`${JSON.stringify(cachePaths)}`); + core14.debug("Cache Paths:"); + core14.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path9.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive Path: ${archivePath}`); + core14.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core13.isDebug()) { + if (core14.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.debug(`File Size: ${archiveFileSize}`); + core14.debug(`File Size: ${archiveFileSize}`); options.archiveSizeBytes = archiveFileSize; - core13.debug("Reserving Cache"); + core14.debug("Reserving Cache"); const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); const request2 = { key, @@ -97608,16 +97501,16 @@ var require_cache5 = __commonJS({ const response = yield twirpClient.CreateCacheEntry(request2); if (!response.ok) { if (response.message) { - core13.warning(`Cache reservation failed: ${response.message}`); + core14.warning(`Cache reservation failed: ${response.message}`); } throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; } catch (error3) { - core13.debug(`Failed to reserve cache: ${error3}`); + core14.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - core13.debug(`Attempting to upload cache located at: ${archivePath}`); + core14.debug(`Attempting to upload cache located at: ${archivePath}`); yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options); const finalizeRequest = { key, @@ -97625,7 +97518,7 @@ var require_cache5 = __commonJS({ sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); - core13.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); + core14.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); if (!finalizeResponse.ok) { if (finalizeResponse.message) { throw new FinalizeCacheError(finalizeResponse.message); @@ -97638,21 +97531,21 @@ var require_cache5 = __commonJS({ if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError.name) { - core13.info(`Failed to save: ${typedError.message}`); + core14.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { - core13.warning(typedError.message); + core14.warning(typedError.message); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to save: ${typedError.message}`); + core14.error(`Failed to save: ${typedError.message}`); } else { - core13.warning(`Failed to save: ${typedError.message}`); + core14.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core13.debug(`Failed to delete archive: ${error3}`); + core14.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -99176,7 +99069,7 @@ var require_retry_helper = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RetryHelper = void 0; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var RetryHelper = class { constructor(maxAttempts, minSeconds, maxSeconds) { if (maxAttempts < 1) { @@ -99199,10 +99092,10 @@ var require_retry_helper = __commonJS({ if (isRetryable && !isRetryable(err)) { throw err; } - core13.info(err.message); + core14.info(err.message); } const seconds = this.getSleepAmount(); - core13.info(`Waiting ${seconds} seconds before trying again`); + core14.info(`Waiting ${seconds} seconds before trying again`); yield this.sleep(seconds); attempt++; } @@ -99305,7 +99198,7 @@ var require_tool_cache = __commonJS({ exports2.findFromManifest = findFromManifest; exports2.isExplicitVersion = isExplicitVersion; exports2.evaluateVersions = evaluateVersions; - var core13 = __importStar2(require_core()); + var core14 = __importStar2(require_core()); var io6 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); var fs9 = __importStar2(require("fs")); @@ -99334,8 +99227,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { dest = dest || path9.join(_getTempDirectory(), crypto2.randomUUID()); yield io6.mkdirP(path9.dirname(dest)); - core13.debug(`Downloading ${url}`); - core13.debug(`Destination ${dest}`); + core14.debug(`Downloading ${url}`); + core14.debug(`Destination ${dest}`); const maxAttempts = 3; const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); @@ -99361,7 +99254,7 @@ var require_tool_cache = __commonJS({ allowRetries: false }); if (auth2) { - core13.debug("set auth"); + core14.debug("set auth"); if (headers === void 0) { headers = {}; } @@ -99370,7 +99263,7 @@ var require_tool_cache = __commonJS({ const response = yield http.get(url, headers); if (response.message.statusCode !== 200) { const err = new HTTPError2(response.message.statusCode); - core13.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } const pipeline = util.promisify(stream2.pipeline); @@ -99379,16 +99272,16 @@ var require_tool_cache = __commonJS({ let succeeded = false; try { yield pipeline(readStream, fs9.createWriteStream(dest)); - core13.debug("download complete"); + core14.debug("download complete"); succeeded = true; return dest; } finally { if (!succeeded) { - core13.debug("download failed"); + core14.debug("download failed"); try { yield io6.rmRF(dest); } catch (err) { - core13.debug(`Failed to delete '${dest}'. ${err.message}`); + core14.debug(`Failed to delete '${dest}'. ${err.message}`); } } } @@ -99403,7 +99296,7 @@ var require_tool_cache = __commonJS({ process.chdir(dest); if (_7zPath) { try { - const logLevel = core13.isDebug() ? "-bb1" : "-bb0"; + const logLevel = core14.isDebug() ? "-bb1" : "-bb0"; const args = [ "x", // eXtract files with full paths @@ -99456,7 +99349,7 @@ var require_tool_cache = __commonJS({ throw new Error("parameter 'file' is required"); } dest = yield _createExtractFolder(dest); - core13.debug("Checking tar --version"); + core14.debug("Checking tar --version"); let versionOutput = ""; yield (0, exec_1.exec)("tar --version", [], { ignoreReturnCode: true, @@ -99466,7 +99359,7 @@ var require_tool_cache = __commonJS({ stderr: (data) => versionOutput += data.toString() } }); - core13.debug(versionOutput.trim()); + core14.debug(versionOutput.trim()); const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); let args; if (flags instanceof Array) { @@ -99474,7 +99367,7 @@ var require_tool_cache = __commonJS({ } else { args = [flags]; } - if (core13.isDebug() && !flags.includes("v")) { + if (core14.isDebug() && !flags.includes("v")) { args.push("-v"); } let destArg = dest; @@ -99505,7 +99398,7 @@ var require_tool_cache = __commonJS({ args = [flags]; } args.push("-x", "-C", dest, "-f", file); - if (core13.isDebug()) { + if (core14.isDebug()) { args.push("-v"); } const xarPath = yield io6.which("xar", true); @@ -99548,7 +99441,7 @@ var require_tool_cache = __commonJS({ "-Command", pwshCommand ]; - core13.debug(`Using pwsh at path: ${pwshPath}`); + core14.debug(`Using pwsh at path: ${pwshPath}`); yield (0, exec_1.exec)(`"${pwshPath}"`, args); } else { const powershellCommand = [ @@ -99568,7 +99461,7 @@ var require_tool_cache = __commonJS({ powershellCommand ]; const powershellPath = yield io6.which("powershell", true); - core13.debug(`Using powershell at path: ${powershellPath}`); + core14.debug(`Using powershell at path: ${powershellPath}`); yield (0, exec_1.exec)(`"${powershellPath}"`, args); } }); @@ -99577,7 +99470,7 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const unzipPath = yield io6.which("unzip", true); const args = [file]; - if (!core13.isDebug()) { + if (!core14.isDebug()) { args.unshift("-q"); } args.unshift("-o"); @@ -99588,8 +99481,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os3.arch(); - core13.debug(`Caching tool ${tool} ${version} ${arch2}`); - core13.debug(`source dir: ${sourceDir}`); + core14.debug(`Caching tool ${tool} ${version} ${arch2}`); + core14.debug(`source dir: ${sourceDir}`); if (!fs9.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } @@ -99606,14 +99499,14 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os3.arch(); - core13.debug(`Caching tool ${tool} ${version} ${arch2}`); - core13.debug(`source file: ${sourceFile}`); + core14.debug(`Caching tool ${tool} ${version} ${arch2}`); + core14.debug(`source file: ${sourceFile}`); if (!fs9.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); const destPath = path9.join(destFolder, targetFile); - core13.debug(`destination file ${destPath}`); + core14.debug(`destination file ${destPath}`); yield io6.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); return destFolder; @@ -99636,12 +99529,12 @@ var require_tool_cache = __commonJS({ if (versionSpec) { versionSpec = semver9.clean(versionSpec) || ""; const cachePath = path9.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core13.debug(`checking cache: ${cachePath}`); + core14.debug(`checking cache: ${cachePath}`); if (fs9.existsSync(cachePath) && fs9.existsSync(`${cachePath}.complete`)) { - core13.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { - core13.debug("not found"); + core14.debug("not found"); } } return toolPath; @@ -99670,7 +99563,7 @@ var require_tool_cache = __commonJS({ const http = new httpm.HttpClient("tool-cache"); const headers = {}; if (auth2) { - core13.debug("set auth"); + core14.debug("set auth"); headers.authorization = auth2; } const response = yield http.getJson(treeUrl, headers); @@ -99691,7 +99584,7 @@ var require_tool_cache = __commonJS({ try { releases = JSON.parse(versionsRaw); } catch (_a) { - core13.debug("Invalid json"); + core14.debug("Invalid json"); } } return releases; @@ -99715,7 +99608,7 @@ var require_tool_cache = __commonJS({ function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { const folderPath = path9.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); - core13.debug(`destination ${folderPath}`); + core14.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io6.rmRF(folderPath); yield io6.rmRF(markerPath); @@ -99727,18 +99620,18 @@ var require_tool_cache = __commonJS({ const folderPath = path9.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; fs9.writeFileSync(markerPath, ""); - core13.debug("finished caching tool"); + core14.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { const c = semver9.clean(versionSpec) || ""; - core13.debug(`isExplicit: ${c}`); + core14.debug(`isExplicit: ${c}`); const valid3 = semver9.valid(c) != null; - core13.debug(`explicit? ${valid3}`); + core14.debug(`explicit? ${valid3}`); return valid3; } function evaluateVersions(versions, versionSpec) { let version = ""; - core13.debug(`evaluating ${versions.length} versions`); + core14.debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver9.gt(a, b)) { return 1; @@ -99754,9 +99647,9 @@ var require_tool_cache = __commonJS({ } } if (version) { - core13.debug(`matched: ${version}`); + core14.debug(`matched: ${version}`); } else { - core13.debug("match not found"); + core14.debug("match not found"); } return version; } @@ -99940,7 +99833,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -100195,7 +100088,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -100211,7 +100104,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -100238,7 +100131,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -100310,11 +100203,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -100332,7 +100225,7 @@ var require_follow_redirects = __commonJS({ }); // src/setup-codeql-action.ts -var core12 = __toESM(require_core()); +var core13 = __toESM(require_core()); // node_modules/uuid/dist-node/stringify.js var byteToHex = []; @@ -103051,6 +102944,14 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.21"; var minimumVersion = "3.14"; +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isString(value) { + return typeof value === "string"; +} + // src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; var BROKEN_VERSIONS = ["0.0.0-20211207"]; @@ -103168,7 +103069,7 @@ var HTTPError = class extends Error { var ConfigurationError = class extends Error { }; function asHTTPError(arg) { - if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { + if (!isObject2(arg) || !isString(arg.message)) { return void 0; } if (Number.isInteger(arg.status)) { @@ -103305,7 +103206,6 @@ async function asyncSome(array, predicate) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -103322,7 +103222,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -103540,6 +103440,7 @@ function parseRepositoryNwo(input) { // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -103554,10 +103455,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -103882,6 +103780,12 @@ function formatDuration(durationMs) { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -104023,70 +103927,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -104098,25 +103980,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -104126,23 +104003,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -104158,11 +104025,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -104180,11 +104044,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -104516,7 +104375,9 @@ function initFeatures(gitHubVersion, repositoryNwo, tempDir, logger) { } // src/init.ts +var core11 = __toESM(require_core()); var toolrunner4 = __toESM(require_toolrunner()); +var github2 = __toESM(require_github()); var io5 = __toESM(require_io()); // src/codeql.ts @@ -104784,6 +104645,7 @@ var semver5 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -104870,28 +104732,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) { const augmentedConfig = cloneObject(cliConfig); @@ -106460,7 +106314,7 @@ async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVe // src/status-report.ts var os2 = __toESM(require("os")); -var core11 = __toESM(require_core()); +var core12 = __toESM(require_core()); function isFirstPartyAnalysis(actionName) { if (actionName !== "upload-sarif" /* UploadSarif */) { return true; @@ -106476,12 +106330,12 @@ function getActionsStatus(error3, otherFailureCause) { } function setJobStatusIfUnsuccessful(actionStatus) { if (actionStatus === "user-error") { - core11.exportVariable( + core12.exportVariable( "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_CONFIGURATION_ERROR" /* ConfigErrorStatus */ ); } else if (actionStatus === "failure" || actionStatus === "aborted") { - core11.exportVariable( + core12.exportVariable( "CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */, process.env["CODEQL_ACTION_JOB_STATUS" /* JOB_STATUS */] ?? "JOB_STATUS_FAILURE" /* FailureStatus */ ); @@ -106500,14 +106354,14 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi let workflowStartedAt = process.env["CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */]; if (workflowStartedAt === void 0) { workflowStartedAt = actionStartedAt.toISOString(); - core11.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); + core12.exportVariable("CODEQL_WORKFLOW_STARTED_AT" /* WORKFLOW_STARTED_AT */, workflowStartedAt); } const runnerOs = getRequiredEnvParam("RUNNER_OS"); const codeQlCliVersion = getCachedCodeQlVersion(); const actionRef = process.env["GITHUB_ACTION_REF"] || ""; const testingEnvironment = getTestingEnvironment(); if (testingEnvironment) { - core11.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); + core12.exportVariable("CODEQL_ACTION_TESTING_ENVIRONMENT" /* TESTING_ENVIRONMENT */, testingEnvironment); } const isSteadyStateDefaultSetupRun = process.env["CODE_SCANNING_IS_STEADY_STATE_DEFAULT_SETUP"] === "true"; const statusReport = { @@ -106590,9 +106444,9 @@ var INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the API endpo async function sendStatusReport(statusReport) { setJobStatusIfUnsuccessful(statusReport.status); const statusReportJSON = JSON.stringify(statusReport); - core11.debug(`Sending status report: ${statusReportJSON}`); + core12.debug(`Sending status report: ${statusReportJSON}`); if (isInTestMode()) { - core11.debug("In test mode. Status reports are not uploaded."); + core12.debug("In test mode. Status reports are not uploaded."); return; } const nwo = getRepositoryNwo(); @@ -106612,28 +106466,28 @@ async function sendStatusReport(statusReport) { switch (httpError.status) { case 403: if (getWorkflowEventName() === "push" && process.env["GITHUB_ACTOR"] === "dependabot[bot]") { - core11.warning( + core12.warning( `Workflows triggered by Dependabot on the "push" event run with read-only access. Uploading CodeQL results requires write access. To use CodeQL with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. See ${"https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#scanning-on-push" /* SCANNING_ON_PUSH */} for more information on how to configure these events.` ); } else { - core11.warning( + core12.warning( `This run of the CodeQL Action does not have permission to access the CodeQL Action API endpoints. This could be because the Action is running on a pull request from a fork. If not, please ensure the workflow has at least the 'security-events: read' permission. Details: ${httpError.message}` ); } return; case 404: - core11.warning(httpError.message); + core12.warning(httpError.message); return; case 422: if (getRequiredEnvParam("GITHUB_SERVER_URL") !== GITHUB_DOTCOM_URL) { - core11.debug(INCOMPATIBLE_MSG); + core12.debug(INCOMPATIBLE_MSG); } else { - core11.debug(OUT_OF_DATE_MSG); + core12.debug(OUT_OF_DATE_MSG); } return; } } - core11.warning( + core12.warning( `An unexpected error occurred when sending a status report: ${getErrorMessage( e )}` @@ -106723,7 +106577,7 @@ async function run(startedAt) { ); const jobRunUuid = v4_default(); logger.info(`Job run UUID is ${jobRunUuid}.`); - core12.exportVariable("JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); + core13.exportVariable("JOB_RUN_UUID" /* JOB_RUN_UUID */, jobRunUuid); const statusReportBase = await createStatusReportBase( "setup-codeql" /* SetupCodeQL */, "starting", @@ -106752,12 +106606,12 @@ async function run(startedAt) { toolsDownloadStatusReport = initCodeQLResult.toolsDownloadStatusReport; toolsVersion = initCodeQLResult.toolsVersion; toolsSource = initCodeQLResult.toolsSource; - core12.setOutput("codeql-path", codeql.getPath()); - core12.setOutput("codeql-version", (await codeql.getVersion()).version); - core12.exportVariable("CODEQL_ACTION_SETUP_CODEQL_HAS_RUN" /* SETUP_CODEQL_ACTION_HAS_RUN */, "true"); + core13.setOutput("codeql-path", codeql.getPath()); + core13.setOutput("codeql-version", (await codeql.getVersion()).version); + core13.exportVariable("CODEQL_ACTION_SETUP_CODEQL_HAS_RUN" /* SETUP_CODEQL_ACTION_HAS_RUN */, "true"); } catch (unwrappedError) { const error3 = wrapError(unwrappedError); - core12.setFailed(error3.message); + core13.setFailed(error3.message); const statusReportBase = await createStatusReportBase( "setup-codeql" /* SetupCodeQL */, error3 instanceof ConfigurationError ? "user-error" : "failure", @@ -106788,7 +106642,7 @@ async function runWrapper() { try { await run(startedAt); } catch (error3) { - core12.setFailed(`setup-codeql action failed: ${getErrorMessage(error3)}`); + core13.setFailed(`setup-codeql action failed: ${getErrorMessage(error3)}`); await sendUnhandledErrorStatusReport( "setup-codeql" /* SetupCodeQL */, startedAt, diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index 73231cfaa8..4d5f78bf7f 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -53394,8 +53287,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -57881,7 +57774,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -57928,7 +57821,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID() { @@ -92763,7 +92656,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -92835,7 +92728,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -101153,7 +101046,7 @@ The following characters are not allowed in files that are uploaded due to limit }); // node_modules/@actions/artifact/package.json -var require_package3 = __commonJS({ +var require_package2 = __commonJS({ "node_modules/@actions/artifact/package.json"(exports2, module2) { module2.exports = { name: "@actions/artifact", @@ -101232,7 +101125,7 @@ var require_user_agent2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = void 0; - var packageJson = require_package3(); + var packageJson = require_package2(); function getUserAgentString() { return `@actions/artifact-${packageJson.version}`; } @@ -105699,10 +105592,10 @@ var require_util20 = __commonJS({ return typeof arg === "number"; } exports2.isNumber = isNumber; - function isString(arg) { + function isString2(arg) { return typeof arg === "string"; } - exports2.isString = isString; + exports2.isString = isString2; function isSymbol(arg) { return typeof arg === "symbol"; } @@ -105715,10 +105608,10 @@ var require_util20 = __commonJS({ return objectToString(re) === "[object RegExp]"; } exports2.isRegExp = isRegExp; - function isObject2(arg) { + function isObject3(arg) { return typeof arg === "object" && arg !== null; } - exports2.isObject = isObject2; + exports2.isObject = isObject3; function isDate(d) { return objectToString(d) === "[object Date]"; } @@ -107760,11 +107653,11 @@ var require_baseGetTag = __commonJS({ // node_modules/lodash/isObject.js var require_isObject = __commonJS({ "node_modules/lodash/isObject.js"(exports2, module2) { - function isObject2(value) { + function isObject3(value) { var type2 = typeof value; return value != null && (type2 == "object" || type2 == "function"); } - module2.exports = isObject2; + module2.exports = isObject3; } }); @@ -107772,13 +107665,13 @@ var require_isObject = __commonJS({ var require_isFunction = __commonJS({ "node_modules/lodash/isFunction.js"(exports2, module2) { var baseGetTag = require_baseGetTag(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var asyncTag = "[object AsyncFunction]"; var funcTag = "[object Function]"; var genTag = "[object GeneratorFunction]"; var proxyTag = "[object Proxy]"; function isFunction(value) { - if (!isObject2(value)) { + if (!isObject3(value)) { return false; } var tag = baseGetTag(value); @@ -107839,7 +107732,7 @@ var require_baseIsNative = __commonJS({ "node_modules/lodash/_baseIsNative.js"(exports2, module2) { var isFunction = require_isFunction(); var isMasked = require_isMasked(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var toSource = require_toSource(); var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; @@ -107851,7 +107744,7 @@ var require_baseIsNative = __commonJS({ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function baseIsNative(value) { - if (!isObject2(value) || isMasked(value)) { + if (!isObject3(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; @@ -108019,9 +107912,9 @@ var require_isIterateeCall = __commonJS({ var eq = require_eq2(); var isArrayLike = require_isArrayLike(); var isIndex = require_isIndex(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); function isIterateeCall(value, index, object) { - if (!isObject2(object)) { + if (!isObject3(object)) { return false; } var type2 = typeof index; @@ -108266,13 +108159,13 @@ var require_nativeKeysIn = __commonJS({ // node_modules/lodash/_baseKeysIn.js var require_baseKeysIn = __commonJS({ "node_modules/lodash/_baseKeysIn.js"(exports2, module2) { - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var isPrototype = require_isPrototype(); var nativeKeysIn = require_nativeKeysIn(); var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function baseKeysIn(object) { - if (!isObject2(object)) { + if (!isObject3(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; @@ -108764,7 +108657,7 @@ var require_event_target_shim = __commonJS({ var CAPTURE = 1; var BUBBLE = 2; var ATTRIBUTE = 3; - function isObject2(x) { + function isObject3(x) { return x !== null && typeof x === "object"; } function getListeners(eventTarget) { @@ -108790,7 +108683,7 @@ var require_event_target_shim = __commonJS({ return null; }, set(listener) { - if (typeof listener !== "function" && !isObject2(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { listener = null; } const listeners = getListeners(this); @@ -108881,11 +108774,11 @@ var require_event_target_shim = __commonJS({ if (listener == null) { return; } - if (typeof listener !== "function" && !isObject2(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { throw new TypeError("'listener' should be a function or an object."); } const listeners = getListeners(this); - const optionsIsObj = isObject2(options); + const optionsIsObj = isObject3(options); const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; const newNode = { @@ -108922,7 +108815,7 @@ var require_event_target_shim = __commonJS({ return; } const listeners = getListeners(this); - const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options); + const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; let prev = null; let node = listeners.get(eventName); @@ -158048,7 +157941,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -158303,7 +158196,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -158319,7 +158212,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -158346,7 +158239,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -158418,11 +158311,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -161100,6 +160993,11 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.21"; var minimumVersion = "3.14"; +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + // src/util.ts var GITHUB_DOTCOM_URL = "https://github.com"; var MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024; @@ -161181,7 +161079,6 @@ function getErrorMessage(error3) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -161198,7 +161095,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } var persistedInputsKey = "persisted_inputs"; var restoreInputs = function() { @@ -161287,6 +161184,7 @@ retry.VERSION = VERSION7; // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -161301,10 +161199,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -161368,6 +161263,7 @@ var semver2 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -161410,6 +161306,12 @@ var semver3 = __toESM(require_semver2()); // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; @@ -161492,70 +161394,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -161567,25 +161447,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -161595,23 +161470,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -161627,11 +161492,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -161649,11 +161511,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -161674,28 +161531,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; function getPathToParsedConfigFile(tempDir) { return path.join(tempDir, "config"); @@ -162152,7 +162001,7 @@ function getArtifactSuffix(matrix) { if (matrix) { try { const matrixObject = JSON.parse(matrix); - if (matrixObject !== null && typeof matrixObject === "object") { + if (isObject2(matrixObject)) { for (const matrixKey of Object.keys(matrixObject).sort()) suffix += `-${matrixObject[matrixKey]}`; } else { diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index e59968114c..ff9f7e54a4 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -47749,12 +47642,12 @@ var require_concat_map = __commonJS({ var res = []; for (var i = 0; i < xs.length; i++) { var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); + if (isArray2(x)) res.push.apply(res, x); else res.push(x); } return res; }; - var isArray = Array.isArray || function(xs) { + var isArray2 = Array.isArray || function(xs) { return Object.prototype.toString.call(xs) === "[object Array]"; }; } @@ -52097,8 +51990,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -56584,7 +56477,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -56631,7 +56524,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID() { @@ -63302,7 +63195,7 @@ var require_Credential = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Credential = void 0; - var Credential = class { + var Credential2 = class { /** * Creates a RequestPolicy object. * @@ -63313,7 +63206,7 @@ var require_Credential = __commonJS({ throw new Error("Method should be implemented in children classes."); } }; - exports2.Credential = Credential; + exports2.Credential = Credential2; } }); @@ -64442,7 +64335,7 @@ var require_Credential2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Credential = void 0; - var Credential = class { + var Credential2 = class { /** * Creates a RequestPolicy object. * @@ -64453,7 +64346,7 @@ var require_Credential2 = __commonJS({ throw new Error("Method should be implemented in children classes."); } }; - exports2.Credential = Credential; + exports2.Credential = Credential2; } }); @@ -91466,7 +91359,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -91538,7 +91431,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -120223,6 +120116,25 @@ var safeDump = renamed("safeDump", "dump"); // src/util.ts var semver = __toESM(require_semver2()); + +// src/json/index.ts +function parseString(data) { + return JSON.parse(data); +} +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isArray(value) { + return Array.isArray(value); +} +function isString(value) { + return typeof value === "string"; +} +function isStringOrUndefined(value) { + return value === void 0 || isString(value); +} + +// src/util.ts var GITHUB_DOTCOM_URL = "https://github.com"; var MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024; function parseGitHubUrl(inputUrl) { @@ -120270,7 +120182,7 @@ var HTTPError = class extends Error { var ConfigurationError = class extends Error { }; function asHTTPError(arg) { - if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { + if (!isObject2(arg) || !isString(arg.message)) { return void 0; } if (Number.isInteger(arg.status)) { @@ -120346,7 +120258,6 @@ function isDefined2(value) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -120363,7 +120274,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -120510,6 +120421,7 @@ function parseRepositoryNwo(input) { // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -120524,10 +120436,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -120731,6 +120640,12 @@ function getActionsLogger() { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; @@ -120815,70 +120730,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -120890,25 +120783,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -120918,23 +120806,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -120950,11 +120828,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -120972,11 +120847,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -121370,6 +121240,95 @@ var KnownLanguage = /* @__PURE__ */ ((KnownLanguage2) => { return KnownLanguage2; })(KnownLanguage || {}); +// src/start-proxy/types.ts +function hasUsername(config) { + return "username" in config; +} +function isUsernamePassword(config) { + return hasUsername(config) && "password" in config; +} +function isToken(config) { + if ("username" in config && !isStringOrUndefined(config.username)) { + return false; + } + return "token" in config && isStringOrUndefined(config.token); +} +function isAzureConfig(config) { + return "tenant_id" in config && "client_id" in config && isDefined2(config.tenant_id) && isDefined2(config.client_id) && isString(config.tenant_id) && isString(config.client_id); +} +function isAWSConfig(config) { + const requiredProperties = [ + "aws_region", + "account_id", + "role_name", + "domain", + "domain_owner" + ]; + for (const property of requiredProperties) { + if (!(property in config) || !isDefined2(config[property]) || !isString(config[property])) { + return false; + } + } + if ("audience" in config && !isStringOrUndefined(config.audience)) { + return false; + } + return true; +} +function isJFrogConfig(config) { + if ("audience" in config && !isStringOrUndefined(config.audience)) { + return false; + } + if ("identity_mapping_name" in config && !isStringOrUndefined(config.identity_mapping_name)) { + return false; + } + return "jfrog_oidc_provider_name" in config && isDefined2(config.jfrog_oidc_provider_name) && isString(config.jfrog_oidc_provider_name); +} +function credentialToStr(credential) { + let result = `Type: ${credential.type};`; + const appendIfDefined = (name, val) => { + if (isDefined2(val)) { + result += ` ${name}: ${val};`; + } + }; + appendIfDefined("Url", credential.url); + appendIfDefined("Host", credential.host); + if (hasUsername(credential)) { + appendIfDefined("Username", credential.username); + } + if ("password" in credential) { + appendIfDefined( + "Password", + isDefined2(credential.password) ? "***" : void 0 + ); + } + if (isToken(credential)) { + appendIfDefined("Token", isDefined2(credential.token) ? "***" : void 0); + } + if (isAzureConfig(credential)) { + appendIfDefined("Tenant", credential.tenant_id); + appendIfDefined("Client", credential.client_id); + } else if (isAWSConfig(credential)) { + appendIfDefined("AWS Region", credential.aws_region); + appendIfDefined("AWS Account", credential.account_id); + appendIfDefined("AWS Role", credential.role_name); + appendIfDefined("AWS Domain", credential.domain); + appendIfDefined("AWS Domain Owner", credential.domain_owner); + appendIfDefined("AWS Audience", credential.audience); + } else if (isJFrogConfig(credential)) { + appendIfDefined("JFrog Provider", credential.jfrog_oidc_provider_name); + appendIfDefined("JFrog Identity Mapping", credential.identity_mapping_name); + appendIfDefined("JFrog Audience", credential.audience); + } + return result; +} +function getAddressString(address) { + if (address.url === void 0) { + return address.host; + } else { + return address.url; + } +} + // src/status-report.ts var os = __toESM(require("os")); var core9 = __toESM(require_core()); @@ -121391,6 +121350,7 @@ var semver5 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -121418,28 +121378,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; // src/status-report.ts @@ -121647,15 +121599,6 @@ async function sendUnhandledErrorStatusReport(actionName, actionStartedAt, error } } -// src/start-proxy/types.ts -function getAddressString(address) { - if (address.url === void 0) { - return address.host; - } else { - return address.url; - } -} - // src/start-proxy.ts function getStartProxyErrorMessage(errorType) { switch (errorType) { @@ -121766,12 +121709,12 @@ var NEW_LANGUAGE_TO_REGISTRY_TYPE = { go: ["goproxy_server", "git_source"] }; function getRegistryAddress(registry) { - if (isDefined2(registry.url)) { + if (isDefined2(registry.url) && isString(registry.url) && isStringOrUndefined(registry.host)) { return { url: registry.url, host: registry.host }; - } else if (isDefined2(registry.host)) { + } else if (isDefined2(registry.host) && isString(registry.host)) { return { url: void 0, host: registry.host @@ -121782,6 +121725,48 @@ function getRegistryAddress(registry) { ); } } +function getAuthConfig(config) { + if (isAzureConfig(config)) { + return { + tenant_id: config.tenant_id, + client_id: config.client_id + }; + } else if (isAWSConfig(config)) { + return { + aws_region: config.aws_region, + account_id: config.account_id, + role_name: config.role_name, + domain: config.domain, + domain_owner: config.domain_owner, + audience: config.audience + }; + } else if (isJFrogConfig(config)) { + return { + jfrog_oidc_provider_name: config.jfrog_oidc_provider_name, + identity_mapping_name: config.identity_mapping_name, + audience: config.audience + }; + } else if (isToken(config)) { + if (isDefined2(config.token)) { + core10.setSecret(config.token); + } + return { username: config.username, token: config.token }; + } else { + let username = void 0; + let password = void 0; + if ("password" in config && isString(config.password)) { + core10.setSecret(config.password); + password = config.password; + } + if ("username" in config && isString(config.username)) { + username = config.username; + } + return { + username, + password + }; + } +} function getCredentials(logger, registrySecrets, registriesCredentials, language, skipUnusedRegistries = false) { const registryMapping = skipUnusedRegistries ? NEW_LANGUAGE_TO_REGISTRY_TYPE : LANGUAGE_TO_REGISTRY_TYPE; const registryTypeForLanguage = language ? registryMapping[language] : void 0; @@ -121798,30 +121783,25 @@ function getCredentials(logger, registrySecrets, registriesCredentials, language } let parsed; try { - parsed = JSON.parse(credentialsStr); + parsed = parseString(credentialsStr); } catch { logger.error("Failed to parse the credentials data."); throw new ConfigurationError("Invalid credentials format."); } - if (!Array.isArray(parsed)) { + if (!isArray(parsed)) { throw new ConfigurationError( "Expected credentials data to be an array of configurations, but it is not." ); } const out = []; for (const e of parsed) { - if (e === null || typeof e !== "object") { + if (e === null || !isObject2(e)) { throw new ConfigurationError("Invalid credentials - must be an object"); } - if (!isDefined2(e.type)) { + if (!isDefined2(e.type) || !isString(e.type)) { throw new ConfigurationError("Invalid credentials - must have a type"); } - if (isDefined2(e.password)) { - core10.setSecret(e.password); - } - if (isDefined2(e.token)) { - core10.setSecret(e.token); - } + const authConfig = getAuthConfig(e); const address = getRegistryAddress(e); if (registryTypeForLanguage && !registryTypeForLanguage.some((t) => t === e.type)) { continue; @@ -121829,21 +121809,22 @@ function getCredentials(logger, registrySecrets, registriesCredentials, language const isPrintable2 = (str2) => { return str2 ? /^[\x20-\x7E]*$/.test(str2) : true; }; - if (!isPrintable2(e.type) || !isPrintable2(e.host) || !isPrintable2(e.url) || !isPrintable2(e.username) || !isPrintable2(e.password) || !isPrintable2(e.token)) { - throw new ConfigurationError( - "Invalid credentials - fields must contain only printable characters" - ); + for (const key of Object.keys(e)) { + const val = e[key]; + if (typeof val === "string" && !isPrintable2(val)) { + throw new ConfigurationError( + "Invalid credentials - fields must contain only printable characters" + ); + } } - if (!isDefined2(e.username) && (isDefined2(e.password) && isPAT(e.password) || isDefined2(e.token) && isPAT(e.token))) { + if ((!hasUsername(authConfig) || !isDefined2(authConfig.username)) && isUsernamePassword(authConfig) && isDefined2(authConfig.password) && isPAT(authConfig.password) || isToken(authConfig) && isDefined2(authConfig.token) && isPAT(authConfig.token)) { logger.warning( `A ${e.type} private registry is configured for ${e.host || e.url} using a GitHub Personal Access Token (PAT), but no username was provided. This may not work correctly. When configuring a private registry using a PAT, select "Username and password" and enter the username of the user who generated the PAT.` ); } out.push({ type: e.type, - username: e.username, - password: e.password, - token: e.token, + ...authConfig, ...address }); } @@ -121905,9 +121886,6 @@ async function getDownloadUrl(logger, features) { version: UPDATEJOB_PROXY_VERSION }; } -function credentialToStr(c) { - return `Type: ${c.type}; Host: ${c.host}; Url: ${c.url} Username: ${c.username}; Password: ${c.password !== void 0}; Token: ${c.token !== void 0}`; -} async function downloadProxy(logger, url, authorization) { try { return toolcache.downloadTool( diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 361812c733..27870330d1 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -3842,18 +3842,18 @@ var require_webidl = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context2) { - const plural = context2.types.length === 1 ? "" : " one of"; - const message = `${context2.argument} could not be converted to${plural}: ${context2.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; return webidl.errors.exception({ - header: context2.prefix, + header: context3.prefix, message }); }; - webidl.errors.invalidArgument = function(context2) { + webidl.errors.invalidArgument = function(context3) { return webidl.errors.exception({ - header: context2.prefix, - message: `"${context2.value}" is an invalid ${context2.type}.` + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -9849,17 +9849,17 @@ var require_api_request = __commonJS({ } } } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -9896,7 +9896,7 @@ var require_api_request = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context2 + context: context3 }); } } @@ -10065,17 +10065,17 @@ var require_api_stream = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context2, callback, responseHeaders } = this; + const { factory, opaque, context: context3, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -10103,7 +10103,7 @@ var require_api_stream = __commonJS({ statusCode, headers, opaque, - context: context2 + context: context3 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -10295,7 +10295,7 @@ var require_api_pipeline = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -10304,10 +10304,10 @@ var require_api_pipeline = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context2 } = this; + const { opaque, handler: handler2, context: context3 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10325,7 +10325,7 @@ var require_api_pipeline = __commonJS({ headers, opaque, body: this.res, - context: context2 + context: context3 }); } catch (err) { this.res.on("error", util.nop); @@ -10409,7 +10409,7 @@ var require_api_upgrade = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; @@ -10423,7 +10423,7 @@ var require_api_upgrade = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10431,7 +10431,7 @@ var require_api_upgrade = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -10500,20 +10500,20 @@ var require_api_connect = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -10525,7 +10525,7 @@ var require_api_connect = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -21321,7 +21321,7 @@ var require_core = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; - exports2.exportVariable = exportVariable5; + exports2.exportVariable = exportVariable6; exports2.setSecret = setSecret; exports2.addPath = addPath; exports2.getInput = getInput2; @@ -21353,7 +21353,7 @@ var require_core = __commonJS({ ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable5(name, val) { + function exportVariable6(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; @@ -26137,18 +26137,18 @@ var require_webidl2 = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context2) { - const plural = context2.types.length === 1 ? "" : " one of"; - const message = `${context2.argument} could not be converted to${plural}: ${context2.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; return webidl.errors.exception({ - header: context2.prefix, + header: context3.prefix, message }); }; - webidl.errors.invalidArgument = function(context2) { + webidl.errors.invalidArgument = function(context3) { return webidl.errors.exception({ - header: context2.prefix, - message: `"${context2.value}" is an invalid ${context2.type}.` + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -32144,17 +32144,17 @@ var require_api_request2 = __commonJS({ } } } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -32191,7 +32191,7 @@ var require_api_request2 = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context2 + context: context3 }); } } @@ -32360,17 +32360,17 @@ var require_api_stream2 = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context2, callback, responseHeaders } = this; + const { factory, opaque, context: context3, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -32398,7 +32398,7 @@ var require_api_stream2 = __commonJS({ statusCode, headers, opaque, - context: context2 + context: context3 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -32590,7 +32590,7 @@ var require_api_pipeline2 = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -32599,10 +32599,10 @@ var require_api_pipeline2 = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context2 } = this; + const { opaque, handler: handler2, context: context3 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -32620,7 +32620,7 @@ var require_api_pipeline2 = __commonJS({ headers, opaque, body: this.res, - context: context2 + context: context3 }); } catch (err) { this.res.on("error", util.nop); @@ -32704,7 +32704,7 @@ var require_api_upgrade2 = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; @@ -32718,7 +32718,7 @@ var require_api_upgrade2 = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -32726,7 +32726,7 @@ var require_api_upgrade2 = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -32795,20 +32795,20 @@ var require_api_connect2 = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -32820,7 +32820,7 @@ var require_api_connect2 = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -41475,8 +41475,8 @@ function isDefined(value) { function isKeyOperator(operator) { return operator === ";" || operator === "&" || operator === "?"; } -function getValues(context2, operator, key, modifier) { - var value = context2[key], result = []; +function getValues(context3, operator, key, modifier) { + var value = context3[key], result = []; if (isDefined(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); @@ -41540,7 +41540,7 @@ function parseUrl(template) { expand: expand.bind(null, template) }; } -function expand(template, context2) { +function expand(template, context3) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, @@ -41554,7 +41554,7 @@ function expand(template, context2) { } expression.split(/,/g).forEach(function(variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context2, operator, tmp[1], tmp[2] || tmp[3])); + values.push(getValues(context3, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; @@ -47278,113 +47278,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -48747,7 +48640,7 @@ var require_internal_glob_options_helper = __commonJS({ })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOptions = getOptions; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); function getOptions(copy) { const result = { followSymbolicLinks: true, @@ -48759,23 +48652,23 @@ var require_internal_glob_options_helper = __commonJS({ if (copy) { if (typeof copy.followSymbolicLinks === "boolean") { result.followSymbolicLinks = copy.followSymbolicLinks; - core12.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + core13.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } if (typeof copy.implicitDescendants === "boolean") { result.implicitDescendants = copy.implicitDescendants; - core12.debug(`implicitDescendants '${result.implicitDescendants}'`); + core13.debug(`implicitDescendants '${result.implicitDescendants}'`); } if (typeof copy.matchDirectories === "boolean") { result.matchDirectories = copy.matchDirectories; - core12.debug(`matchDirectories '${result.matchDirectories}'`); + core13.debug(`matchDirectories '${result.matchDirectories}'`); } if (typeof copy.omitBrokenSymbolicLinks === "boolean") { result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core12.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + core13.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } if (typeof copy.excludeHiddenFiles === "boolean") { result.excludeHiddenFiles = copy.excludeHiddenFiles; - core12.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + core13.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } return result; @@ -50403,7 +50296,7 @@ var require_internal_globber = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var fs13 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); var path12 = __importStar2(require("path")); @@ -50456,7 +50349,7 @@ var require_internal_globber = __commonJS({ } const stack = []; for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core12.debug(`Search path '${searchPath}'`); + core13.debug(`Search path '${searchPath}'`); try { yield __await2(fs13.promises.lstat(searchPath)); } catch (err) { @@ -50531,7 +50424,7 @@ var require_internal_globber = __commonJS({ } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { - core12.debug(`Broken symlink '${item.path}'`); + core13.debug(`Broken symlink '${item.path}'`); return void 0; } throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); @@ -50547,7 +50440,7 @@ var require_internal_globber = __commonJS({ traversalChain.pop(); } if (traversalChain.some((x) => x === realPath)) { - core12.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + core13.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); return void 0; } traversalChain.push(realPath); @@ -50650,7 +50543,7 @@ var require_internal_hash_files = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hashFiles = hashFiles; var crypto2 = __importStar2(require("crypto")); - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var fs13 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); @@ -50659,7 +50552,7 @@ var require_internal_hash_files = __commonJS({ return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; - const writeDelegate = verbose ? core12.info : core12.debug; + const writeDelegate = verbose ? core13.info : core13.debug; let hasMatch = false; const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); const result = crypto2.createHash("sha256"); @@ -52050,7 +51943,7 @@ var require_cacheUtils = __commonJS({ exports2.assertDefined = assertDefined; exports2.getCacheVersion = getCacheVersion; exports2.getRuntimeToken = getRuntimeToken; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var exec = __importStar2(require_exec()); var glob = __importStar2(require_glob()); var io6 = __importStar2(require_io()); @@ -52101,7 +51994,7 @@ var require_cacheUtils = __commonJS({ _e = false; const file = _c; const relativeFile = path12.relative(workspace, file).replace(new RegExp(`\\${path12.sep}`, "g"), "/"); - core12.debug(`Matched: ${relativeFile}`); + core13.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); } else { @@ -52129,7 +52022,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { let versionOutput = ""; additionalArgs.push("--version"); - core12.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + core13.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, @@ -52140,10 +52033,10 @@ var require_cacheUtils = __commonJS({ } }); } catch (err) { - core12.debug(err.message); + core13.debug(err.message); } versionOutput = versionOutput.trim(); - core12.debug(versionOutput); + core13.debug(versionOutput); return versionOutput; }); } @@ -52151,7 +52044,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); const version = semver9.clean(versionOutput); - core12.debug(`zstd version: ${version}`); + core13.debug(`zstd version: ${version}`); if (versionOutput === "") { return constants_1.CompressionMethod.Gzip; } else { @@ -52276,14 +52169,14 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { + var context3 = {}; + for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; + context3.addInitializer = function(f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context3); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); @@ -53010,19 +52903,19 @@ var require_logger = __commonJS({ logger: clientLogger }; } - var context2 = createLoggerContext({ + var context3 = createLoggerContext({ logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", namespace: "typeSpecRuntime" }); - exports2.TypeSpecRuntimeLogger = context2.logger; + exports2.TypeSpecRuntimeLogger = context3.logger; function setLogLevel(logLevel) { - context2.setLogLevel(logLevel); + context3.setLogLevel(logLevel); } function getLogLevel() { - return context2.getLogLevel(); + return context3.getLogLevel(); } function createClientLogger(namespace) { - return context2.createClientLogger(namespace); + return context3.createClientLogger(namespace); } } }); @@ -53394,8 +53287,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -57268,19 +57161,19 @@ var require_commonjs2 = __commonJS({ exports2.getLogLevel = getLogLevel; exports2.createClientLogger = createClientLogger; var logger_1 = require_internal(); - var context2 = (0, logger_1.createLoggerContext)({ + var context3 = (0, logger_1.createLoggerContext)({ logLevelEnvVarName: "AZURE_LOG_LEVEL", namespace: "azure" }); - exports2.AzureLogger = context2.logger; + exports2.AzureLogger = context3.logger; function setLogLevel(level) { - context2.setLogLevel(level); + context3.setLogLevel(level); } function getLogLevel() { - return context2.getLogLevel(); + return context3.getLogLevel(); } function createClientLogger(namespace) { - return context2.createClientLogger(namespace); + return context3.createClientLogger(namespace); } } }); @@ -57881,7 +57774,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID2; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -57928,7 +57821,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID2() { @@ -58190,14 +58083,14 @@ var require_tracingContext = __commonJS({ namespace: /* @__PURE__ */ Symbol.for("@azure/core-tracing namespace") }; function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); + let context3 = new TracingContextImpl(options.parentContext); if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + context3 = context3.setValue(exports2.knownContextKeys.span, options.span); } if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + context3 = context3.setValue(exports2.knownContextKeys.namespace, options.namespace); } - return context2; + return context3; } var TracingContextImpl = class _TracingContextImpl { _contextMap; @@ -58335,8 +58228,8 @@ var require_tracingClient = __commonJS({ span.end(); } } - function withContext(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); + function withContext(context3, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context3, callback, ...callbackArgs); } function parseTraceparentHeader(traceparentHeader) { return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); @@ -91807,7 +91700,7 @@ var require_uploadUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadProgress = void 0; exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors3(); var UploadProgress = class { @@ -91849,7 +91742,7 @@ var require_uploadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const uploadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core12.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); + core13.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -91906,14 +91799,14 @@ var require_uploadUtils = __commonJS({ }; try { uploadProgress.startDisplayTimer(); - core12.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + core13.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); if (response._response.status >= 400) { throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; } catch (error3) { - core12.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + core13.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); throw error3; } finally { uploadProgress.stopDisplayTimer(); @@ -91998,7 +91891,7 @@ var require_requestUtils = __commonJS({ exports2.retry = retry2; exports2.retryTypedResponse = retryTypedResponse; exports2.retryHttpClientResponse = retryHttpClientResponse; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var http_client_1 = require_lib(); var constants_1 = require_constants12(); function isSuccessStatusCode(statusCode) { @@ -92056,9 +91949,9 @@ var require_requestUtils = __commonJS({ isRetryable = isRetryableStatusCode(statusCode); errorMessage = `Cache service responded with ${statusCode}`; } - core12.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + core13.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); if (!isRetryable) { - core12.debug(`${name} - Error is not retryable`); + core13.debug(`${name} - Error is not retryable`); break; } yield sleep(delay2); @@ -92317,7 +92210,7 @@ var require_downloadUtils = __commonJS({ exports2.downloadCacheHttpClient = downloadCacheHttpClient; exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); @@ -92355,7 +92248,7 @@ var require_downloadUtils = __commonJS({ this.segmentIndex = this.segmentIndex + 1; this.segmentSize = segmentSize; this.receivedBytes = 0; - core12.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); + core13.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** * Sets the number of bytes received for the current segment. @@ -92389,7 +92282,7 @@ var require_downloadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core12.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + core13.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -92439,7 +92332,7 @@ var require_downloadUtils = __commonJS({ })); downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); - core12.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); + core13.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, writeStream); const contentLengthHeader = downloadResponse.message.headers["content-length"]; @@ -92450,7 +92343,7 @@ var require_downloadUtils = __commonJS({ throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { - core12.debug("Unable to validate download, no Content-Length header"); + core13.debug("Unable to validate download, no Content-Length header"); } }); } @@ -92568,7 +92461,7 @@ var require_downloadUtils = __commonJS({ const properties = yield client.getProperties(); const contentLength = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; if (contentLength < 0) { - core12.debug("Unable to determine content length, downloading file with http-client..."); + core13.debug("Unable to determine content length, downloading file with http-client..."); yield downloadCacheHttpClient(archiveLocation, archivePath); } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); @@ -92658,7 +92551,7 @@ var require_options = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadOptions = getUploadOptions; exports2.getDownloadOptions = getDownloadOptions; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -92678,9 +92571,9 @@ var require_options = __commonJS({ } result.uploadConcurrency = !isNaN(Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) ? Math.min(32, Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) : result.uploadConcurrency; result.uploadChunkSize = !isNaN(Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"])) ? Math.min(128 * 1024 * 1024, Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"]) * 1024 * 1024) : result.uploadChunkSize; - core12.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core12.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core12.debug(`Upload chunk size: ${result.uploadChunkSize}`); + core13.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core13.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core13.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } function getDownloadOptions(copy) { @@ -92716,12 +92609,12 @@ var require_options = __commonJS({ if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; } - core12.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core12.debug(`Download concurrency: ${result.downloadConcurrency}`); - core12.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core12.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core12.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core12.debug(`Lookup only: ${result.lookupOnly}`); + core13.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core13.debug(`Download concurrency: ${result.downloadConcurrency}`); + core13.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core13.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core13.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core13.debug(`Lookup only: ${result.lookupOnly}`); return result; } } @@ -92763,7 +92656,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -92835,7 +92728,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -92915,7 +92808,7 @@ var require_cacheHttpClient = __commonJS({ exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; exports2.saveCache = saveCache4; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); var fs13 = __importStar2(require("fs")); @@ -92933,7 +92826,7 @@ var require_cacheHttpClient = __commonJS({ throw new Error("Cache Service Url not found, unable to restore cache."); } const url2 = `${baseUrl}_apis/artifactcache/${resource}`; - core12.debug(`Resource Url: ${url2}`); + core13.debug(`Resource Url: ${url2}`); return url2; } function createAcceptHeader(type2, apiVersion) { @@ -92961,7 +92854,7 @@ var require_cacheHttpClient = __commonJS({ return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { - if (core12.isDebug()) { + if (core13.isDebug()) { yield printCachesListForDiagnostics(keys[0], httpClient, version); } return null; @@ -92974,9 +92867,9 @@ var require_cacheHttpClient = __commonJS({ if (!cacheDownloadUrl) { throw new Error("Cache not found."); } - core12.setSecret(cacheDownloadUrl); - core12.debug(`Cache Result:`); - core12.debug(JSON.stringify(cacheResult)); + core13.setSecret(cacheDownloadUrl); + core13.debug(`Cache Result:`); + core13.debug(JSON.stringify(cacheResult)); return cacheResult; }); } @@ -92990,10 +92883,10 @@ var require_cacheHttpClient = __commonJS({ const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - core12.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + core13.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`); for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { - core12.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); + core13.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); } } } @@ -93036,7 +92929,7 @@ Other caches with similar key:`); } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { return __awaiter2(this, void 0, void 0, function* () { - core12.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); + core13.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); const additionalHeaders = { "Content-Type": "application/octet-stream", "Content-Range": getContentRange(start, end) @@ -93058,7 +92951,7 @@ Other caches with similar key:`); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); const parallelUploads = [...new Array(concurrency).keys()]; - core12.debug("Awaiting all uploads"); + core13.debug("Awaiting all uploads"); let offset = 0; try { yield Promise.all(parallelUploads.map(() => __awaiter2(this, void 0, void 0, function* () { @@ -93101,16 +92994,16 @@ Other caches with similar key:`); yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); } else { const httpClient = createHttpClient(); - core12.debug("Upload cache"); + core13.debug("Upload cache"); yield uploadFile(httpClient, cacheId, archivePath, options); - core12.debug("Commiting cache"); + core13.debug("Commiting cache"); const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); + core13.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); } - core12.info("Cache saved successfully"); + core13.info("Cache saved successfully"); } }); } @@ -98593,7 +98486,7 @@ var require_cache5 = __commonJS({ exports2.isFeatureAvailable = isFeatureAvailable; exports2.restoreCache = restoreCache4; exports2.saveCache = saveCache4; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var path12 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); @@ -98652,7 +98545,7 @@ var require_cache5 = __commonJS({ function restoreCache4(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core12.debug(`Cache service version: ${cacheServiceVersion}`); + core13.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); switch (cacheServiceVersion) { case "v2": @@ -98667,8 +98560,8 @@ var require_cache5 = __commonJS({ return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core12.debug("Resolved Keys:"); - core12.debug(JSON.stringify(keys)); + core13.debug("Resolved Keys:"); + core13.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -98686,19 +98579,19 @@ var require_cache5 = __commonJS({ return void 0; } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core12.info("Lookup only - skipping download"); + core13.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } archivePath = path12.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core12.debug(`Archive Path: ${archivePath}`); + core13.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core12.isDebug()) { + if (core13.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core12.info("Cache restored successfully"); + core13.info("Cache restored successfully"); return cacheEntry.cacheKey; } catch (error3) { const typedError = error3; @@ -98706,16 +98599,16 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to restore: ${error3.message}`); + core13.error(`Failed to restore: ${error3.message}`); } else { - core12.warning(`Failed to restore: ${error3.message}`); + core13.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core12.debug(`Failed to delete archive: ${error3}`); + core13.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -98726,8 +98619,8 @@ var require_cache5 = __commonJS({ options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core12.debug("Resolved Keys:"); - core12.debug(JSON.stringify(keys)); + core13.debug("Resolved Keys:"); + core13.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -98745,30 +98638,30 @@ var require_cache5 = __commonJS({ }; const response = yield twirpClient.GetCacheEntryDownloadURL(request2); if (!response.ok) { - core12.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); + core13.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); return void 0; } const isRestoreKeyMatch = request2.key !== response.matchedKey; if (isRestoreKeyMatch) { - core12.info(`Cache hit for restore-key: ${response.matchedKey}`); + core13.info(`Cache hit for restore-key: ${response.matchedKey}`); } else { - core12.info(`Cache hit for: ${response.matchedKey}`); + core13.info(`Cache hit for: ${response.matchedKey}`); } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core12.info("Lookup only - skipping download"); + core13.info("Lookup only - skipping download"); return response.matchedKey; } archivePath = path12.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core12.debug(`Archive path: ${archivePath}`); - core12.debug(`Starting download of archive to: ${archivePath}`); + core13.debug(`Archive path: ${archivePath}`); + core13.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core12.isDebug()) { + core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core13.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core12.info("Cache restored successfully"); + core13.info("Cache restored successfully"); return response.matchedKey; } catch (error3) { const typedError = error3; @@ -98776,9 +98669,9 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to restore: ${error3.message}`); + core13.error(`Failed to restore: ${error3.message}`); } else { - core12.warning(`Failed to restore: ${error3.message}`); + core13.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -98787,7 +98680,7 @@ var require_cache5 = __commonJS({ yield utils.unlinkFile(archivePath); } } catch (error3) { - core12.debug(`Failed to delete archive: ${error3}`); + core13.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -98796,7 +98689,7 @@ var require_cache5 = __commonJS({ function saveCache4(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core12.debug(`Cache service version: ${cacheServiceVersion}`); + core13.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); checkKey(key); switch (cacheServiceVersion) { @@ -98814,26 +98707,26 @@ var require_cache5 = __commonJS({ const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core12.debug("Cache Paths:"); - core12.debug(`${JSON.stringify(cachePaths)}`); + core13.debug("Cache Paths:"); + core13.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path12.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core12.debug(`Archive Path: ${archivePath}`); + core13.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core12.isDebug()) { + if (core13.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const fileSizeLimit = 10 * 1024 * 1024 * 1024; const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.debug(`File Size: ${archiveFileSize}`); + core13.debug(`File Size: ${archiveFileSize}`); if (archiveFileSize > fileSizeLimit && !(0, config_1.isGhes)()) { throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); } - core12.debug("Reserving Cache"); + core13.debug("Reserving Cache"); const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { compressionMethod, enableCrossOsArchive, @@ -98846,26 +98739,26 @@ var require_cache5 = __commonJS({ } else { throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); } - core12.debug(`Saving Cache (ID: ${cacheId})`); + core13.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); } catch (error3) { const typedError = error3; if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError.name) { - core12.info(`Failed to save: ${typedError.message}`); + core13.info(`Failed to save: ${typedError.message}`); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to save: ${typedError.message}`); + core13.error(`Failed to save: ${typedError.message}`); } else { - core12.warning(`Failed to save: ${typedError.message}`); + core13.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core12.debug(`Failed to delete archive: ${error3}`); + core13.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -98878,23 +98771,23 @@ var require_cache5 = __commonJS({ const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core12.debug("Cache Paths:"); - core12.debug(`${JSON.stringify(cachePaths)}`); + core13.debug("Cache Paths:"); + core13.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path12.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core12.debug(`Archive Path: ${archivePath}`); + core13.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core12.isDebug()) { + if (core13.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.debug(`File Size: ${archiveFileSize}`); + core13.debug(`File Size: ${archiveFileSize}`); options.archiveSizeBytes = archiveFileSize; - core12.debug("Reserving Cache"); + core13.debug("Reserving Cache"); const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); const request2 = { key, @@ -98905,16 +98798,16 @@ var require_cache5 = __commonJS({ const response = yield twirpClient.CreateCacheEntry(request2); if (!response.ok) { if (response.message) { - core12.warning(`Cache reservation failed: ${response.message}`); + core13.warning(`Cache reservation failed: ${response.message}`); } throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; } catch (error3) { - core12.debug(`Failed to reserve cache: ${error3}`); + core13.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - core12.debug(`Attempting to upload cache located at: ${archivePath}`); + core13.debug(`Attempting to upload cache located at: ${archivePath}`); yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options); const finalizeRequest = { key, @@ -98922,7 +98815,7 @@ var require_cache5 = __commonJS({ sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); - core12.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); + core13.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); if (!finalizeResponse.ok) { if (finalizeResponse.message) { throw new FinalizeCacheError(finalizeResponse.message); @@ -98935,21 +98828,21 @@ var require_cache5 = __commonJS({ if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError.name) { - core12.info(`Failed to save: ${typedError.message}`); + core13.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { - core12.warning(typedError.message); + core13.warning(typedError.message); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to save: ${typedError.message}`); + core13.error(`Failed to save: ${typedError.message}`); } else { - core12.warning(`Failed to save: ${typedError.message}`); + core13.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core12.debug(`Failed to delete archive: ${error3}`); + core13.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -99176,7 +99069,7 @@ var require_retry_helper = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RetryHelper = void 0; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var RetryHelper = class { constructor(maxAttempts, minSeconds, maxSeconds) { if (maxAttempts < 1) { @@ -99199,10 +99092,10 @@ var require_retry_helper = __commonJS({ if (isRetryable && !isRetryable(err)) { throw err; } - core12.info(err.message); + core13.info(err.message); } const seconds = this.getSleepAmount(); - core12.info(`Waiting ${seconds} seconds before trying again`); + core13.info(`Waiting ${seconds} seconds before trying again`); yield this.sleep(seconds); attempt++; } @@ -99305,7 +99198,7 @@ var require_tool_cache = __commonJS({ exports2.findFromManifest = findFromManifest; exports2.isExplicitVersion = isExplicitVersion; exports2.evaluateVersions = evaluateVersions; - var core12 = __importStar2(require_core()); + var core13 = __importStar2(require_core()); var io6 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); var fs13 = __importStar2(require("fs")); @@ -99334,8 +99227,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { dest = dest || path12.join(_getTempDirectory(), crypto2.randomUUID()); yield io6.mkdirP(path12.dirname(dest)); - core12.debug(`Downloading ${url2}`); - core12.debug(`Destination ${dest}`); + core13.debug(`Downloading ${url2}`); + core13.debug(`Destination ${dest}`); const maxAttempts = 3; const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); @@ -99361,7 +99254,7 @@ var require_tool_cache = __commonJS({ allowRetries: false }); if (auth2) { - core12.debug("set auth"); + core13.debug("set auth"); if (headers === void 0) { headers = {}; } @@ -99370,7 +99263,7 @@ var require_tool_cache = __commonJS({ const response = yield http.get(url2, headers); if (response.message.statusCode !== 200) { const err = new HTTPError2(response.message.statusCode); - core12.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + core13.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } const pipeline = util.promisify(stream2.pipeline); @@ -99379,16 +99272,16 @@ var require_tool_cache = __commonJS({ let succeeded = false; try { yield pipeline(readStream, fs13.createWriteStream(dest)); - core12.debug("download complete"); + core13.debug("download complete"); succeeded = true; return dest; } finally { if (!succeeded) { - core12.debug("download failed"); + core13.debug("download failed"); try { yield io6.rmRF(dest); } catch (err) { - core12.debug(`Failed to delete '${dest}'. ${err.message}`); + core13.debug(`Failed to delete '${dest}'. ${err.message}`); } } } @@ -99403,7 +99296,7 @@ var require_tool_cache = __commonJS({ process.chdir(dest); if (_7zPath) { try { - const logLevel = core12.isDebug() ? "-bb1" : "-bb0"; + const logLevel = core13.isDebug() ? "-bb1" : "-bb0"; const args = [ "x", // eXtract files with full paths @@ -99456,7 +99349,7 @@ var require_tool_cache = __commonJS({ throw new Error("parameter 'file' is required"); } dest = yield _createExtractFolder(dest); - core12.debug("Checking tar --version"); + core13.debug("Checking tar --version"); let versionOutput = ""; yield (0, exec_1.exec)("tar --version", [], { ignoreReturnCode: true, @@ -99466,7 +99359,7 @@ var require_tool_cache = __commonJS({ stderr: (data) => versionOutput += data.toString() } }); - core12.debug(versionOutput.trim()); + core13.debug(versionOutput.trim()); const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); let args; if (flags instanceof Array) { @@ -99474,7 +99367,7 @@ var require_tool_cache = __commonJS({ } else { args = [flags]; } - if (core12.isDebug() && !flags.includes("v")) { + if (core13.isDebug() && !flags.includes("v")) { args.push("-v"); } let destArg = dest; @@ -99505,7 +99398,7 @@ var require_tool_cache = __commonJS({ args = [flags]; } args.push("-x", "-C", dest, "-f", file); - if (core12.isDebug()) { + if (core13.isDebug()) { args.push("-v"); } const xarPath = yield io6.which("xar", true); @@ -99548,7 +99441,7 @@ var require_tool_cache = __commonJS({ "-Command", pwshCommand ]; - core12.debug(`Using pwsh at path: ${pwshPath}`); + core13.debug(`Using pwsh at path: ${pwshPath}`); yield (0, exec_1.exec)(`"${pwshPath}"`, args); } else { const powershellCommand = [ @@ -99568,7 +99461,7 @@ var require_tool_cache = __commonJS({ powershellCommand ]; const powershellPath = yield io6.which("powershell", true); - core12.debug(`Using powershell at path: ${powershellPath}`); + core13.debug(`Using powershell at path: ${powershellPath}`); yield (0, exec_1.exec)(`"${powershellPath}"`, args); } }); @@ -99577,7 +99470,7 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const unzipPath = yield io6.which("unzip", true); const args = [file]; - if (!core12.isDebug()) { + if (!core13.isDebug()) { args.unshift("-q"); } args.unshift("-o"); @@ -99588,8 +99481,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os2.arch(); - core12.debug(`Caching tool ${tool} ${version} ${arch2}`); - core12.debug(`source dir: ${sourceDir}`); + core13.debug(`Caching tool ${tool} ${version} ${arch2}`); + core13.debug(`source dir: ${sourceDir}`); if (!fs13.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } @@ -99606,14 +99499,14 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os2.arch(); - core12.debug(`Caching tool ${tool} ${version} ${arch2}`); - core12.debug(`source file: ${sourceFile}`); + core13.debug(`Caching tool ${tool} ${version} ${arch2}`); + core13.debug(`source file: ${sourceFile}`); if (!fs13.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); const destPath = path12.join(destFolder, targetFile); - core12.debug(`destination file ${destPath}`); + core13.debug(`destination file ${destPath}`); yield io6.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); return destFolder; @@ -99636,12 +99529,12 @@ var require_tool_cache = __commonJS({ if (versionSpec) { versionSpec = semver9.clean(versionSpec) || ""; const cachePath = path12.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core12.debug(`checking cache: ${cachePath}`); + core13.debug(`checking cache: ${cachePath}`); if (fs13.existsSync(cachePath) && fs13.existsSync(`${cachePath}.complete`)) { - core12.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + core13.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { - core12.debug("not found"); + core13.debug("not found"); } } return toolPath; @@ -99670,7 +99563,7 @@ var require_tool_cache = __commonJS({ const http = new httpm.HttpClient("tool-cache"); const headers = {}; if (auth2) { - core12.debug("set auth"); + core13.debug("set auth"); headers.authorization = auth2; } const response = yield http.getJson(treeUrl, headers); @@ -99691,7 +99584,7 @@ var require_tool_cache = __commonJS({ try { releases = JSON.parse(versionsRaw); } catch (_a) { - core12.debug("Invalid json"); + core13.debug("Invalid json"); } } return releases; @@ -99715,7 +99608,7 @@ var require_tool_cache = __commonJS({ function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { const folderPath = path12.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); - core12.debug(`destination ${folderPath}`); + core13.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io6.rmRF(folderPath); yield io6.rmRF(markerPath); @@ -99727,18 +99620,18 @@ var require_tool_cache = __commonJS({ const folderPath = path12.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; fs13.writeFileSync(markerPath, ""); - core12.debug("finished caching tool"); + core13.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { const c = semver9.clean(versionSpec) || ""; - core12.debug(`isExplicit: ${c}`); + core13.debug(`isExplicit: ${c}`); const valid3 = semver9.valid(c) != null; - core12.debug(`explicit? ${valid3}`); + core13.debug(`explicit? ${valid3}`); return valid3; } function evaluateVersions(versions, versionSpec) { let version = ""; - core12.debug(`evaluating ${versions.length} versions`); + core13.debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver9.gt(a, b)) { return 1; @@ -99754,9 +99647,9 @@ var require_tool_cache = __commonJS({ } } if (version) { - core12.debug(`matched: ${version}`); + core13.debug(`matched: ${version}`); } else { - core12.debug("match not found"); + core13.debug("match not found"); } return version; } @@ -99940,7 +99833,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -100195,7 +100088,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -100211,7 +100104,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -100238,7 +100131,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url2.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -100310,11 +100203,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -103253,7 +103146,7 @@ var fs12 = __toESM(require("fs")); var path11 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); -var core11 = __toESM(require_core()); +var core12 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib2()); // src/actions-util.ts @@ -105913,6 +105806,16 @@ var safeDump = renamed("safeDump", "dump"); // src/util.ts var semver = __toESM(require_semver2()); + +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isString(value) { + return typeof value === "string"; +} + +// src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; var BROKEN_VERSIONS = ["0.0.0-20211207"]; var GITHUB_DOTCOM_URL = "https://github.com"; @@ -105996,7 +105899,7 @@ var HTTPError = class extends Error { var ConfigurationError = class extends Error { }; function asHTTPError(arg) { - if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { + if (!isObject2(arg) || !isString(arg.message)) { return void 0; } if (Number.isInteger(arg.status)) { @@ -106098,7 +106001,6 @@ async function asyncSome(array, predicate) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -106115,7 +106017,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -106416,6 +106318,7 @@ function parseRepositoryNwo(input) { // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -106430,10 +106333,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -106826,6 +106726,7 @@ var semver2 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -107143,6 +107044,12 @@ async function isAnalyzingDefaultBranch() { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -107282,70 +107189,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -107357,25 +107242,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -107385,23 +107265,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -107417,11 +107287,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -107439,11 +107306,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -107482,28 +107344,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; function getPathToParsedConfigFile(tempDir) { return path6.join(tempDir, "config"); @@ -110151,7 +110005,7 @@ function locationUpdateCallback(result, location, logger) { } function resolveUriToFile(location, artifacts, sourceRoot, logger) { if (!location.uri && location.index !== void 0) { - if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") { + if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || !isObject2(artifacts[location.index].location)) { logger.debug(`Ignoring location as index "${location.index}" is invalid`); return void 0; } @@ -110247,7 +110101,9 @@ async function addFingerprints(sarifLog, sourceRoot, logger) { } // src/init.ts +var core11 = __toESM(require_core()); var toolrunner4 = __toESM(require_toolrunner()); +var github2 = __toESM(require_github()); var io5 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); @@ -110352,10 +110208,7 @@ function areAllRunsUnique(sarifLogs) { // src/upload-lib.ts var GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning."; var GENERIC_404_MSG = "The CodeQL code scanning feature is forbidden on this repository."; -async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) { - if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { - return false; - } +async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects) { return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING; } async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) { @@ -110388,14 +110241,11 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo logger.debug( "Not all SARIF files were produced by CodeQL. Merging files in the action." ); - if (await shouldShowCombineSarifFilesDeprecationWarning( - sarifObjects, - gitHubVersion - )) { + if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects)) { logger.warning( `Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}` ); - core11.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); + core12.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); } return combineSarifFiles(sarifFiles, logger); } @@ -110494,13 +110344,13 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { if (httpError !== void 0) { switch (httpError.status) { case 403: - core11.warning(httpError.message || GENERIC_403_MSG); + core12.warning(httpError.message || GENERIC_403_MSG); break; case 404: - core11.warning(httpError.message || GENERIC_404_MSG); + core12.warning(httpError.message || GENERIC_404_MSG); break; default: - core11.warning(httpError.message); + core12.warning(httpError.message); break; } } @@ -110934,7 +110784,7 @@ function validateUniqueCategory(sarifLog, sentinelPrefix) { `Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. The easiest fix is to specify a unique value for the \`category\` input. If .runs[].automationDetails.id is specified in the sarif file, that will take precedence over your configured \`category\`. Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})` ); } - core11.exportVariable(sentinelEnvVar, sentinelEnvVar); + core12.exportVariable(sentinelEnvVar, sentinelEnvVar); } } function sanitize(str2) { diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index b1b9f19062..1566f48968 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -53828,7 +53721,7 @@ The following characters are not allowed in files that are uploaded due to limit }); // node_modules/@actions/artifact/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/artifact/package.json"(exports2, module2) { module2.exports = { name: "@actions/artifact", @@ -53907,7 +53800,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = void 0; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/artifact-${packageJson.version}`; } @@ -55607,8 +55500,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -60094,7 +59987,7 @@ var require_commonjs6 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -60141,7 +60034,7 @@ var require_commonjs6 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID() { @@ -97883,10 +97776,10 @@ var require_util19 = __commonJS({ return typeof arg === "number"; } exports2.isNumber = isNumber; - function isString(arg) { + function isString2(arg) { return typeof arg === "string"; } - exports2.isString = isString; + exports2.isString = isString2; function isSymbol(arg) { return typeof arg === "symbol"; } @@ -97899,10 +97792,10 @@ var require_util19 = __commonJS({ return objectToString(re) === "[object RegExp]"; } exports2.isRegExp = isRegExp; - function isObject2(arg) { + function isObject3(arg) { return typeof arg === "object" && arg !== null; } - exports2.isObject = isObject2; + exports2.isObject = isObject3; function isDate(d) { return objectToString(d) === "[object Date]"; } @@ -99944,11 +99837,11 @@ var require_baseGetTag = __commonJS({ // node_modules/lodash/isObject.js var require_isObject = __commonJS({ "node_modules/lodash/isObject.js"(exports2, module2) { - function isObject2(value) { + function isObject3(value) { var type2 = typeof value; return value != null && (type2 == "object" || type2 == "function"); } - module2.exports = isObject2; + module2.exports = isObject3; } }); @@ -99956,13 +99849,13 @@ var require_isObject = __commonJS({ var require_isFunction = __commonJS({ "node_modules/lodash/isFunction.js"(exports2, module2) { var baseGetTag = require_baseGetTag(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var asyncTag = "[object AsyncFunction]"; var funcTag = "[object Function]"; var genTag = "[object GeneratorFunction]"; var proxyTag = "[object Proxy]"; function isFunction(value) { - if (!isObject2(value)) { + if (!isObject3(value)) { return false; } var tag = baseGetTag(value); @@ -100023,7 +99916,7 @@ var require_baseIsNative = __commonJS({ "node_modules/lodash/_baseIsNative.js"(exports2, module2) { var isFunction = require_isFunction(); var isMasked = require_isMasked(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var toSource = require_toSource(); var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; var reIsHostCtor = /^\[object .+?Constructor\]$/; @@ -100035,7 +99928,7 @@ var require_baseIsNative = __commonJS({ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function baseIsNative(value) { - if (!isObject2(value) || isMasked(value)) { + if (!isObject3(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; @@ -100203,9 +100096,9 @@ var require_isIterateeCall = __commonJS({ var eq = require_eq2(); var isArrayLike = require_isArrayLike(); var isIndex = require_isIndex(); - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); function isIterateeCall(value, index, object) { - if (!isObject2(object)) { + if (!isObject3(object)) { return false; } var type2 = typeof index; @@ -100450,13 +100343,13 @@ var require_nativeKeysIn = __commonJS({ // node_modules/lodash/_baseKeysIn.js var require_baseKeysIn = __commonJS({ "node_modules/lodash/_baseKeysIn.js"(exports2, module2) { - var isObject2 = require_isObject(); + var isObject3 = require_isObject(); var isPrototype = require_isPrototype(); var nativeKeysIn = require_nativeKeysIn(); var objectProto = Object.prototype; var hasOwnProperty = objectProto.hasOwnProperty; function baseKeysIn(object) { - if (!isObject2(object)) { + if (!isObject3(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; @@ -100948,7 +100841,7 @@ var require_event_target_shim = __commonJS({ var CAPTURE = 1; var BUBBLE = 2; var ATTRIBUTE = 3; - function isObject2(x) { + function isObject3(x) { return x !== null && typeof x === "object"; } function getListeners(eventTarget) { @@ -100974,7 +100867,7 @@ var require_event_target_shim = __commonJS({ return null; }, set(listener) { - if (typeof listener !== "function" && !isObject2(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { listener = null; } const listeners = getListeners(this); @@ -101065,11 +100958,11 @@ var require_event_target_shim = __commonJS({ if (listener == null) { return; } - if (typeof listener !== "function" && !isObject2(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { throw new TypeError("'listener' should be a function or an object."); } const listeners = getListeners(this); - const optionsIsObj = isObject2(options); + const optionsIsObj = isObject3(options); const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; const newNode = { @@ -101106,7 +100999,7 @@ var require_event_target_shim = __commonJS({ return; } const listeners = getListeners(this); - const capture = isObject2(options) ? Boolean(options.capture) : Boolean(options); + const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; let prev = null; let node = listeners.get(eventName); @@ -155097,7 +154990,7 @@ var require_config2 = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package3 = __commonJS({ +var require_package2 = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -155169,7 +155062,7 @@ var require_user_agent2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package3(); + var packageJson = require_package2(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -158048,7 +157941,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -158303,7 +158196,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -158319,7 +158212,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -158346,7 +158239,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -158418,11 +158311,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -161100,6 +160993,11 @@ var semver = __toESM(require_semver2()); var maximumVersion = "3.21"; var minimumVersion = "3.14"; +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + // src/util.ts var GITHUB_DOTCOM_URL = "https://github.com"; var MINIMUM_CGROUP_MEMORY_LIMIT_BYTES = 1024 * 1024; @@ -161181,7 +161079,6 @@ function getErrorMessage(error3) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -161198,7 +161095,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } var persistedInputsKey = "persisted_inputs"; var restoreInputs = function() { @@ -161287,6 +161184,7 @@ retry.VERSION = VERSION7; // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -161301,10 +161199,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -161518,6 +161413,7 @@ var semver2 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -161568,6 +161464,12 @@ var semver3 = __toESM(require_semver2()); // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; @@ -161654,70 +161556,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -161729,25 +161609,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -161757,23 +161632,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -161789,11 +161654,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -161811,11 +161673,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -161836,28 +161693,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; // src/setup-codeql.ts @@ -162174,7 +162023,7 @@ function getArtifactSuffix(matrix) { if (matrix) { try { const matrixObject = JSON.parse(matrix); - if (matrixObject !== null && typeof matrixObject === "object") { + if (isObject2(matrixObject)) { for (const matrixKey of Object.keys(matrixObject).sort()) suffix += `-${matrixObject[matrixKey]}`; } else { diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 43058f5c05..76f845388f 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -3842,18 +3842,18 @@ var require_webidl = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context2) { - const plural = context2.types.length === 1 ? "" : " one of"; - const message = `${context2.argument} could not be converted to${plural}: ${context2.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; return webidl.errors.exception({ - header: context2.prefix, + header: context3.prefix, message }); }; - webidl.errors.invalidArgument = function(context2) { + webidl.errors.invalidArgument = function(context3) { return webidl.errors.exception({ - header: context2.prefix, - message: `"${context2.value}" is an invalid ${context2.type}.` + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -9849,17 +9849,17 @@ var require_api_request = __commonJS({ } } } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -9896,7 +9896,7 @@ var require_api_request = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context2 + context: context3 }); } } @@ -10065,17 +10065,17 @@ var require_api_stream = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context2, callback, responseHeaders } = this; + const { factory, opaque, context: context3, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -10103,7 +10103,7 @@ var require_api_stream = __commonJS({ statusCode, headers, opaque, - context: context2 + context: context3 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -10295,7 +10295,7 @@ var require_api_pipeline = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -10304,10 +10304,10 @@ var require_api_pipeline = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context2 } = this; + const { opaque, handler: handler2, context: context3 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10325,7 +10325,7 @@ var require_api_pipeline = __commonJS({ headers, opaque, body: this.res, - context: context2 + context: context3 }); } catch (err) { this.res.on("error", util.nop); @@ -10409,7 +10409,7 @@ var require_api_upgrade = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; @@ -10423,7 +10423,7 @@ var require_api_upgrade = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -10431,7 +10431,7 @@ var require_api_upgrade = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -10500,20 +10500,20 @@ var require_api_connect = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -10525,7 +10525,7 @@ var require_api_connect = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -21321,7 +21321,7 @@ var require_core = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; - exports2.exportVariable = exportVariable6; + exports2.exportVariable = exportVariable7; exports2.setSecret = setSecret; exports2.addPath = addPath; exports2.getInput = getInput2; @@ -21353,7 +21353,7 @@ var require_core = __commonJS({ ExitCode2[ExitCode2["Success"] = 0] = "Success"; ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; })(ExitCode || (exports2.ExitCode = ExitCode = {})); - function exportVariable6(name, val) { + function exportVariable7(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env["GITHUB_ENV"] || ""; @@ -24840,18 +24840,18 @@ var require_webidl2 = __commonJS({ webidl.errors.exception = function(message) { return new TypeError(`${message.header}: ${message.message}`); }; - webidl.errors.conversionFailed = function(context2) { - const plural = context2.types.length === 1 ? "" : " one of"; - const message = `${context2.argument} could not be converted to${plural}: ${context2.types.join(", ")}.`; + webidl.errors.conversionFailed = function(context3) { + const plural = context3.types.length === 1 ? "" : " one of"; + const message = `${context3.argument} could not be converted to${plural}: ${context3.types.join(", ")}.`; return webidl.errors.exception({ - header: context2.prefix, + header: context3.prefix, message }); }; - webidl.errors.invalidArgument = function(context2) { + webidl.errors.invalidArgument = function(context3) { return webidl.errors.exception({ - header: context2.prefix, - message: `"${context2.value}" is an invalid ${context2.type}.` + header: context3.prefix, + message: `"${context3.value}" is an invalid ${context3.type}.` }); }; webidl.brandCheck = function(V, I, opts) { @@ -30847,17 +30847,17 @@ var require_api_request2 = __commonJS({ } } } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this; + const { callback, opaque, abort, context: context3, responseHeaders, highWaterMark } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -30894,7 +30894,7 @@ var require_api_request2 = __commonJS({ trailers: this.trailers, opaque, body: res, - context: context2 + context: context3 }); } } @@ -31063,17 +31063,17 @@ var require_api_stream2 = __commonJS({ } addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume, statusMessage) { - const { factory, opaque, context: context2, callback, responseHeaders } = this; + const { factory, opaque, context: context3, callback, responseHeaders } = this; const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { @@ -31101,7 +31101,7 @@ var require_api_stream2 = __commonJS({ statusCode, headers, opaque, - context: context2 + context: context3 }); if (!res || typeof res.write !== "function" || typeof res.end !== "function" || typeof res.on !== "function") { throw new InvalidReturnValueError("expected Writable"); @@ -31293,7 +31293,7 @@ var require_api_pipeline2 = __commonJS({ this.res = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { const { ret, res } = this; if (this.reason) { abort(this.reason); @@ -31302,10 +31302,10 @@ var require_api_pipeline2 = __commonJS({ assert(!res, "pipeline cannot be retried"); assert(!ret.destroyed); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders(statusCode, rawHeaders, resume) { - const { opaque, handler: handler2, context: context2 } = this; + const { opaque, handler: handler2, context: context3 } = this; if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31323,7 +31323,7 @@ var require_api_pipeline2 = __commonJS({ headers, opaque, body: this.res, - context: context2 + context: context3 }); } catch (err) { this.res.on("error", util.nop); @@ -31407,7 +31407,7 @@ var require_api_upgrade2 = __commonJS({ this.context = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; @@ -31421,7 +31421,7 @@ var require_api_upgrade2 = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { assert(statusCode === 101); - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); @@ -31429,7 +31429,7 @@ var require_api_upgrade2 = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -31498,20 +31498,20 @@ var require_api_connect2 = __commonJS({ this.abort = null; addSignal(this, signal); } - onConnect(abort, context2) { + onConnect(abort, context3) { if (this.reason) { abort(this.reason); return; } assert(this.callback); this.abort = abort; - this.context = context2; + this.context = context3; } onHeaders() { throw new SocketError("bad connect", null); } onUpgrade(statusCode, rawHeaders, socket) { - const { callback, opaque, context: context2 } = this; + const { callback, opaque, context: context3 } = this; removeSignal(this); this.callback = null; let headers = rawHeaders; @@ -31523,7 +31523,7 @@ var require_api_connect2 = __commonJS({ headers, socket, opaque, - context: context2 + context: context3 }); } onError(err) { @@ -40178,8 +40178,8 @@ function isDefined(value) { function isKeyOperator(operator) { return operator === ";" || operator === "&" || operator === "?"; } -function getValues(context2, operator, key, modifier) { - var value = context2[key], result = []; +function getValues(context3, operator, key, modifier) { + var value = context3[key], result = []; if (isDefined(value) && value !== "") { if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") { value = value.toString(); @@ -40243,7 +40243,7 @@ function parseUrl(template) { expand: expand.bind(null, template) }; } -function expand(template, context2) { +function expand(template, context3) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; template = template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, @@ -40257,7 +40257,7 @@ function expand(template, context2) { } expression.split(/,/g).forEach(function(variable) { var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable); - values.push(getValues(context2, operator, tmp[1], tmp[2] || tmp[3])); + values.push(getValues(context3, operator, tmp[1], tmp[2] || tmp[3])); }); if (operator && operator !== "+") { var separator = ","; @@ -45981,113 +45981,6 @@ var require_semver2 = __commonJS({ } }); -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "3.32.6", - private: true, - description: "CodeQL action", - scripts: { - _build_comment: "echo 'Run the full build so we typecheck the project and can reuse the transpiled files in npm test'", - build: "./scripts/check-node-modules.sh && npm run transpile && node build.mjs", - lint: "eslint --report-unused-disable-directives --max-warnings=0 .", - "lint-ci": "SARIF_ESLINT_IGNORE_SUPPRESSED=true eslint --report-unused-disable-directives --max-warnings=0 . --format @microsoft/eslint-formatter-sarif --output-file=eslint.sarif", - "lint-fix": "eslint --report-unused-disable-directives --max-warnings=0 . --fix", - ava: "npm run transpile && ava --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^5.0.3", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^5.0.5", - "@actions/core": "^2.0.3", - "@actions/exec": "^2.0.0", - "@actions/github": "^8.0.1", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^3.0.1", - "@octokit/plugin-retry": "^8.0.0", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "https-proxy-agent": "^7.0.6", - "js-yaml": "^4.1.1", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.3", - semver: "^7.7.4", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^2.0.2", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "^20.19.9", - "@types/node-forge": "^1.3.14", - "@types/sarif": "^2.1.7", - "@types/semver": "^7.7.1", - "@types/sinon": "^21.0.0", - ava: "^6.4.1", - esbuild: "^0.27.3", - eslint: "^9.39.2", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-github": "^6.0.0", - "eslint-plugin-import-x": "^4.16.1", - "eslint-plugin-jsdoc": "^62.7.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.1.0", - globals: "^17.3.0", - nock: "^14.0.11", - sinon: "^21.0.1", - typescript: "^5.9.3", - "typescript-eslint": "^8.56.1" - }, - overrides: { - "@actions/tool-cache": { - semver: ">=6.3.1" - }, - "@octokit/request-error": { - semver: ">=5.1.1" - }, - "@octokit/request": { - semver: ">=8.4.1" - }, - "@octokit/plugin-paginate-rest": { - semver: ">=9.2.2" - }, - "eslint-plugin-import": { - semver: ">=6.3.1" - }, - "eslint-plugin-jsx-a11y": { - semver: ">=6.3.1" - }, - "brace-expansion@2.0.1": "2.0.2", - glob: "^11.1.0" - } - }; - } -}); - // node_modules/bottleneck/light.js var require_light = __commonJS({ "node_modules/bottleneck/light.js"(exports2, module2) { @@ -47450,7 +47343,7 @@ var require_internal_glob_options_helper = __commonJS({ })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOptions = getOptions; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); function getOptions(copy) { const result = { followSymbolicLinks: true, @@ -47462,23 +47355,23 @@ var require_internal_glob_options_helper = __commonJS({ if (copy) { if (typeof copy.followSymbolicLinks === "boolean") { result.followSymbolicLinks = copy.followSymbolicLinks; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + core15.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } if (typeof copy.implicitDescendants === "boolean") { result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + core15.debug(`implicitDescendants '${result.implicitDescendants}'`); } if (typeof copy.matchDirectories === "boolean") { result.matchDirectories = copy.matchDirectories; - core14.debug(`matchDirectories '${result.matchDirectories}'`); + core15.debug(`matchDirectories '${result.matchDirectories}'`); } if (typeof copy.omitBrokenSymbolicLinks === "boolean") { result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + core15.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } if (typeof copy.excludeHiddenFiles === "boolean") { result.excludeHiddenFiles = copy.excludeHiddenFiles; - core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + core15.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } return result; @@ -49106,7 +48999,7 @@ var require_internal_globber = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DefaultGlobber = void 0; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var fs14 = __importStar2(require("fs")); var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); var path13 = __importStar2(require("path")); @@ -49159,7 +49052,7 @@ var require_internal_globber = __commonJS({ } const stack = []; for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core14.debug(`Search path '${searchPath}'`); + core15.debug(`Search path '${searchPath}'`); try { yield __await2(fs14.promises.lstat(searchPath)); } catch (err) { @@ -49234,7 +49127,7 @@ var require_internal_globber = __commonJS({ } catch (err) { if (err.code === "ENOENT") { if (options.omitBrokenSymbolicLinks) { - core14.debug(`Broken symlink '${item.path}'`); + core15.debug(`Broken symlink '${item.path}'`); return void 0; } throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); @@ -49250,7 +49143,7 @@ var require_internal_globber = __commonJS({ traversalChain.pop(); } if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + core15.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); return void 0; } traversalChain.push(realPath); @@ -49353,7 +49246,7 @@ var require_internal_hash_files = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hashFiles = hashFiles; var crypto2 = __importStar2(require("crypto")); - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var fs14 = __importStar2(require("fs")); var stream2 = __importStar2(require("stream")); var util = __importStar2(require("util")); @@ -49362,7 +49255,7 @@ var require_internal_hash_files = __commonJS({ return __awaiter2(this, arguments, void 0, function* (globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; - const writeDelegate = verbose ? core14.info : core14.debug; + const writeDelegate = verbose ? core15.info : core15.debug; let hasMatch = false; const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); const result = crypto2.createHash("sha256"); @@ -50753,7 +50646,7 @@ var require_cacheUtils = __commonJS({ exports2.assertDefined = assertDefined; exports2.getCacheVersion = getCacheVersion; exports2.getRuntimeToken = getRuntimeToken; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var exec = __importStar2(require_exec()); var glob = __importStar2(require_glob()); var io6 = __importStar2(require_io()); @@ -50804,7 +50697,7 @@ var require_cacheUtils = __commonJS({ _e = false; const file = _c; const relativeFile = path13.relative(workspace, file).replace(new RegExp(`\\${path13.sep}`, "g"), "/"); - core14.debug(`Matched: ${relativeFile}`); + core15.debug(`Matched: ${relativeFile}`); if (relativeFile === "") { paths.push("."); } else { @@ -50832,7 +50725,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { let versionOutput = ""; additionalArgs.push("--version"); - core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + core15.debug(`Checking ${app} ${additionalArgs.join(" ")}`); try { yield exec.exec(`${app}`, additionalArgs, { ignoreReturnCode: true, @@ -50843,10 +50736,10 @@ var require_cacheUtils = __commonJS({ } }); } catch (err) { - core14.debug(err.message); + core15.debug(err.message); } versionOutput = versionOutput.trim(); - core14.debug(versionOutput); + core15.debug(versionOutput); return versionOutput; }); } @@ -50854,7 +50747,7 @@ var require_cacheUtils = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); const version = semver9.clean(versionOutput); - core14.debug(`zstd version: ${version}`); + core15.debug(`zstd version: ${version}`); if (versionOutput === "") { return constants_1.CompressionMethod.Gzip; } else { @@ -50979,14 +50872,14 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { + var context3 = {}; + for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; + context3.addInitializer = function(f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context3); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); @@ -51713,19 +51606,19 @@ var require_logger = __commonJS({ logger: clientLogger }; } - var context2 = createLoggerContext({ + var context3 = createLoggerContext({ logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", namespace: "typeSpecRuntime" }); - exports2.TypeSpecRuntimeLogger = context2.logger; + exports2.TypeSpecRuntimeLogger = context3.logger; function setLogLevel(logLevel) { - context2.setLogLevel(logLevel); + context3.setLogLevel(logLevel); } function getLogLevel() { - return context2.getLogLevel(); + return context3.getLogLevel(); } function createClientLogger(namespace) { - return context2.createClientLogger(namespace); + return context3.createClientLogger(namespace); } } }); @@ -52097,8 +51990,8 @@ var require_object = __commonJS({ "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isObject = isObject2; - function isObject2(input) { + exports2.isObject = isObject3; + function isObject3(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } @@ -55971,19 +55864,19 @@ var require_commonjs2 = __commonJS({ exports2.getLogLevel = getLogLevel; exports2.createClientLogger = createClientLogger; var logger_1 = require_internal(); - var context2 = (0, logger_1.createLoggerContext)({ + var context3 = (0, logger_1.createLoggerContext)({ logLevelEnvVarName: "AZURE_LOG_LEVEL", namespace: "azure" }); - exports2.AzureLogger = context2.logger; + exports2.AzureLogger = context3.logger; function setLogLevel(level) { - context2.setLogLevel(level); + context3.setLogLevel(level); } function getLogLevel() { - return context2.getLogLevel(); + return context3.getLogLevel(); } function createClientLogger(namespace) { - return context2.createClientLogger(namespace); + return context3.createClientLogger(namespace); } } }); @@ -56584,7 +56477,7 @@ var require_commonjs4 = __commonJS({ exports2.computeSha256Hmac = computeSha256Hmac; exports2.getRandomIntegerInclusive = getRandomIntegerInclusive; exports2.isError = isError; - exports2.isObject = isObject2; + exports2.isObject = isObject3; exports2.randomUUID = randomUUID2; exports2.uint8ArrayToString = uint8ArrayToString; exports2.stringToUint8Array = stringToUint8Array; @@ -56631,7 +56524,7 @@ var require_commonjs4 = __commonJS({ function isError(e) { return tspRuntime.isError(e); } - function isObject2(input) { + function isObject3(input) { return tspRuntime.isObject(input); } function randomUUID2() { @@ -56893,14 +56786,14 @@ var require_tracingContext = __commonJS({ namespace: /* @__PURE__ */ Symbol.for("@azure/core-tracing namespace") }; function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); + let context3 = new TracingContextImpl(options.parentContext); if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + context3 = context3.setValue(exports2.knownContextKeys.span, options.span); } if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + context3 = context3.setValue(exports2.knownContextKeys.namespace, options.namespace); } - return context2; + return context3; } var TracingContextImpl = class _TracingContextImpl { _contextMap; @@ -57038,8 +56931,8 @@ var require_tracingClient = __commonJS({ span.end(); } } - function withContext(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); + function withContext(context3, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context3, callback, ...callbackArgs); } function parseTraceparentHeader(traceparentHeader) { return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); @@ -90510,7 +90403,7 @@ var require_uploadUtils = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadProgress = void 0; exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors3(); var UploadProgress = class { @@ -90552,7 +90445,7 @@ var require_uploadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const uploadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core14.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); + core15.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -90609,14 +90502,14 @@ var require_uploadUtils = __commonJS({ }; try { uploadProgress.startDisplayTimer(); - core14.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); + core15.debug(`BlobClient: ${blobClient.name}:${blobClient.accountName}:${blobClient.containerName}`); const response = yield blockBlobClient.uploadFile(archivePath, uploadOptions); if (response._response.status >= 400) { throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; } catch (error3) { - core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + core15.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); throw error3; } finally { uploadProgress.stopDisplayTimer(); @@ -90701,7 +90594,7 @@ var require_requestUtils = __commonJS({ exports2.retry = retry2; exports2.retryTypedResponse = retryTypedResponse; exports2.retryHttpClientResponse = retryHttpClientResponse; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var http_client_1 = require_lib(); var constants_1 = require_constants12(); function isSuccessStatusCode(statusCode) { @@ -90759,9 +90652,9 @@ var require_requestUtils = __commonJS({ isRetryable = isRetryableStatusCode(statusCode); errorMessage = `Cache service responded with ${statusCode}`; } - core14.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + core15.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); if (!isRetryable) { - core14.debug(`${name} - Error is not retryable`); + core15.debug(`${name} - Error is not retryable`); break; } yield sleep(delay2); @@ -91020,7 +90913,7 @@ var require_downloadUtils = __commonJS({ exports2.downloadCacheHttpClient = downloadCacheHttpClient; exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var http_client_1 = require_lib(); var storage_blob_1 = require_commonjs15(); var buffer = __importStar2(require("buffer")); @@ -91058,7 +90951,7 @@ var require_downloadUtils = __commonJS({ this.segmentIndex = this.segmentIndex + 1; this.segmentSize = segmentSize; this.receivedBytes = 0; - core14.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); + core15.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** * Sets the number of bytes received for the current segment. @@ -91092,7 +90985,7 @@ var require_downloadUtils = __commonJS({ const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1); const elapsedTime = Date.now() - this.startTime; const downloadSpeed = (transferredBytes / (1024 * 1024) / (elapsedTime / 1e3)).toFixed(1); - core14.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + core15.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); if (this.isDone()) { this.displayedComplete = true; } @@ -91142,7 +91035,7 @@ var require_downloadUtils = __commonJS({ })); downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { downloadResponse.message.destroy(); - core14.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); + core15.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`); }); yield pipeResponseToStream(downloadResponse, writeStream); const contentLengthHeader = downloadResponse.message.headers["content-length"]; @@ -91153,7 +91046,7 @@ var require_downloadUtils = __commonJS({ throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`); } } else { - core14.debug("Unable to validate download, no Content-Length header"); + core15.debug("Unable to validate download, no Content-Length header"); } }); } @@ -91271,7 +91164,7 @@ var require_downloadUtils = __commonJS({ const properties = yield client.getProperties(); const contentLength = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; if (contentLength < 0) { - core14.debug("Unable to determine content length, downloading file with http-client..."); + core15.debug("Unable to determine content length, downloading file with http-client..."); yield downloadCacheHttpClient(archiveLocation, archivePath); } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); @@ -91361,7 +91254,7 @@ var require_options = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUploadOptions = getUploadOptions; exports2.getDownloadOptions = getDownloadOptions; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -91381,9 +91274,9 @@ var require_options = __commonJS({ } result.uploadConcurrency = !isNaN(Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) ? Math.min(32, Number(process.env["CACHE_UPLOAD_CONCURRENCY"])) : result.uploadConcurrency; result.uploadChunkSize = !isNaN(Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"])) ? Math.min(128 * 1024 * 1024, Number(process.env["CACHE_UPLOAD_CHUNK_SIZE"]) * 1024 * 1024) : result.uploadChunkSize; - core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core14.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core14.debug(`Upload chunk size: ${result.uploadChunkSize}`); + core15.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core15.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core15.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } function getDownloadOptions(copy) { @@ -91419,12 +91312,12 @@ var require_options = __commonJS({ if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; } - core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core14.debug(`Download concurrency: ${result.downloadConcurrency}`); - core14.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core14.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core14.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core14.debug(`Lookup only: ${result.lookupOnly}`); + core15.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core15.debug(`Download concurrency: ${result.downloadConcurrency}`); + core15.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core15.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core15.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core15.debug(`Lookup only: ${result.lookupOnly}`); return result; } } @@ -91466,7 +91359,7 @@ var require_config = __commonJS({ }); // node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ +var require_package = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", @@ -91538,7 +91431,7 @@ var require_user_agent = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); + var packageJson = require_package(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } @@ -91618,7 +91511,7 @@ var require_cacheHttpClient = __commonJS({ exports2.downloadCache = downloadCache; exports2.reserveCache = reserveCache; exports2.saveCache = saveCache4; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var http_client_1 = require_lib(); var auth_1 = require_auth(); var fs14 = __importStar2(require("fs")); @@ -91636,7 +91529,7 @@ var require_cacheHttpClient = __commonJS({ throw new Error("Cache Service Url not found, unable to restore cache."); } const url2 = `${baseUrl}_apis/artifactcache/${resource}`; - core14.debug(`Resource Url: ${url2}`); + core15.debug(`Resource Url: ${url2}`); return url2; } function createAcceptHeader(type2, apiVersion) { @@ -91664,7 +91557,7 @@ var require_cacheHttpClient = __commonJS({ return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { - if (core14.isDebug()) { + if (core15.isDebug()) { yield printCachesListForDiagnostics(keys[0], httpClient, version); } return null; @@ -91677,9 +91570,9 @@ var require_cacheHttpClient = __commonJS({ if (!cacheDownloadUrl) { throw new Error("Cache not found."); } - core14.setSecret(cacheDownloadUrl); - core14.debug(`Cache Result:`); - core14.debug(JSON.stringify(cacheResult)); + core15.setSecret(cacheDownloadUrl); + core15.debug(`Cache Result:`); + core15.debug(JSON.stringify(cacheResult)); return cacheResult; }); } @@ -91693,10 +91586,10 @@ var require_cacheHttpClient = __commonJS({ const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - core14.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + core15.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`); for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { - core14.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); + core15.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); } } } @@ -91739,7 +91632,7 @@ Other caches with similar key:`); } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { return __awaiter2(this, void 0, void 0, function* () { - core14.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); + core15.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`); const additionalHeaders = { "Content-Type": "application/octet-stream", "Content-Range": getContentRange(start, end) @@ -91761,7 +91654,7 @@ Other caches with similar key:`); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); const parallelUploads = [...new Array(concurrency).keys()]; - core14.debug("Awaiting all uploads"); + core15.debug("Awaiting all uploads"); let offset = 0; try { yield Promise.all(parallelUploads.map(() => __awaiter2(this, void 0, void 0, function* () { @@ -91804,16 +91697,16 @@ Other caches with similar key:`); yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); } else { const httpClient = createHttpClient(); - core14.debug("Upload cache"); + core15.debug("Upload cache"); yield uploadFile(httpClient, cacheId, archivePath, options); - core14.debug("Commiting cache"); + core15.debug("Commiting cache"); const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); + core15.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`); const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize); if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) { throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`); } - core14.info("Cache saved successfully"); + core15.info("Cache saved successfully"); } }); } @@ -97296,7 +97189,7 @@ var require_cache5 = __commonJS({ exports2.isFeatureAvailable = isFeatureAvailable; exports2.restoreCache = restoreCache4; exports2.saveCache = saveCache4; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var path13 = __importStar2(require("path")); var utils = __importStar2(require_cacheUtils()); var cacheHttpClient = __importStar2(require_cacheHttpClient()); @@ -97355,7 +97248,7 @@ var require_cache5 = __commonJS({ function restoreCache4(paths_1, primaryKey_1, restoreKeys_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); + core15.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); switch (cacheServiceVersion) { case "v2": @@ -97370,8 +97263,8 @@ var require_cache5 = __commonJS({ return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.debug(JSON.stringify(keys)); + core15.debug("Resolved Keys:"); + core15.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -97389,19 +97282,19 @@ var require_cache5 = __commonJS({ return void 0; } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); + core15.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } archivePath = path13.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); + core15.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core14.isDebug()) { + if (core15.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + core15.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); + core15.info("Cache restored successfully"); return cacheEntry.cacheKey; } catch (error3) { const typedError = error3; @@ -97409,16 +97302,16 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error3.message}`); + core15.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error3.message}`); + core15.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core14.debug(`Failed to delete archive: ${error3}`); + core15.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -97429,8 +97322,8 @@ var require_cache5 = __commonJS({ options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.debug(JSON.stringify(keys)); + core15.debug("Resolved Keys:"); + core15.debug(JSON.stringify(keys)); if (keys.length > 10) { throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`); } @@ -97448,30 +97341,30 @@ var require_cache5 = __commonJS({ }; const response = yield twirpClient.GetCacheEntryDownloadURL(request2); if (!response.ok) { - core14.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); + core15.debug(`Cache not found for version ${request2.version} of keys: ${keys.join(", ")}`); return void 0; } const isRestoreKeyMatch = request2.key !== response.matchedKey; if (isRestoreKeyMatch) { - core14.info(`Cache hit for restore-key: ${response.matchedKey}`); + core15.info(`Cache hit for restore-key: ${response.matchedKey}`); } else { - core14.info(`Cache hit for: ${response.matchedKey}`); + core15.info(`Cache hit for: ${response.matchedKey}`); } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); + core15.info("Lookup only - skipping download"); return response.matchedKey; } archivePath = path13.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive path: ${archivePath}`); - core14.debug(`Starting download of archive to: ${archivePath}`); + core15.debug(`Archive path: ${archivePath}`); + core15.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core14.isDebug()) { + core15.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core15.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); + core15.info("Cache restored successfully"); return response.matchedKey; } catch (error3) { const typedError = error3; @@ -97479,9 +97372,9 @@ var require_cache5 = __commonJS({ throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error3.message}`); + core15.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error3.message}`); + core15.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -97490,7 +97383,7 @@ var require_cache5 = __commonJS({ yield utils.unlinkFile(archivePath); } } catch (error3) { - core14.debug(`Failed to delete archive: ${error3}`); + core15.debug(`Failed to delete archive: ${error3}`); } } return void 0; @@ -97499,7 +97392,7 @@ var require_cache5 = __commonJS({ function saveCache4(paths_1, key_1, options_1) { return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); + core15.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); checkKey(key); switch (cacheServiceVersion) { @@ -97517,26 +97410,26 @@ var require_cache5 = __commonJS({ const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core14.debug("Cache Paths:"); - core14.debug(`${JSON.stringify(cachePaths)}`); + core15.debug("Cache Paths:"); + core15.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path13.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); + core15.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { + if (core15.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const fileSizeLimit = 10 * 1024 * 1024 * 1024; const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.debug(`File Size: ${archiveFileSize}`); + core15.debug(`File Size: ${archiveFileSize}`); if (archiveFileSize > fileSizeLimit && !(0, config_1.isGhes)()) { throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`); } - core14.debug("Reserving Cache"); + core15.debug("Reserving Cache"); const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { compressionMethod, enableCrossOsArchive, @@ -97549,26 +97442,26 @@ var require_cache5 = __commonJS({ } else { throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); } - core14.debug(`Saving Cache (ID: ${cacheId})`); + core15.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); } catch (error3) { const typedError = error3; if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError.name) { - core14.info(`Failed to save: ${typedError.message}`); + core15.info(`Failed to save: ${typedError.message}`); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); + core15.error(`Failed to save: ${typedError.message}`); } else { - core14.warning(`Failed to save: ${typedError.message}`); + core15.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core14.debug(`Failed to delete archive: ${error3}`); + core15.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -97581,23 +97474,23 @@ var require_cache5 = __commonJS({ const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); - core14.debug("Cache Paths:"); - core14.debug(`${JSON.stringify(cachePaths)}`); + core15.debug("Cache Paths:"); + core15.debug(`${JSON.stringify(cachePaths)}`); if (cachePaths.length === 0) { throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`); } const archiveFolder = yield utils.createTempDirectory(); const archivePath = path13.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); + core15.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { + if (core15.isDebug()) { yield (0, tar_1.listTar)(archivePath, compressionMethod); } const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.debug(`File Size: ${archiveFileSize}`); + core15.debug(`File Size: ${archiveFileSize}`); options.archiveSizeBytes = archiveFileSize; - core14.debug("Reserving Cache"); + core15.debug("Reserving Cache"); const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); const request2 = { key, @@ -97608,16 +97501,16 @@ var require_cache5 = __commonJS({ const response = yield twirpClient.CreateCacheEntry(request2); if (!response.ok) { if (response.message) { - core14.warning(`Cache reservation failed: ${response.message}`); + core15.warning(`Cache reservation failed: ${response.message}`); } throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; } catch (error3) { - core14.debug(`Failed to reserve cache: ${error3}`); + core15.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - core14.debug(`Attempting to upload cache located at: ${archivePath}`); + core15.debug(`Attempting to upload cache located at: ${archivePath}`); yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options); const finalizeRequest = { key, @@ -97625,7 +97518,7 @@ var require_cache5 = __commonJS({ sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); - core14.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); + core15.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); if (!finalizeResponse.ok) { if (finalizeResponse.message) { throw new FinalizeCacheError(finalizeResponse.message); @@ -97638,21 +97531,21 @@ var require_cache5 = __commonJS({ if (typedError.name === ValidationError.name) { throw error3; } else if (typedError.name === ReserveCacheError.name) { - core14.info(`Failed to save: ${typedError.message}`); + core15.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { - core14.warning(typedError.message); + core15.warning(typedError.message); } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); + core15.error(`Failed to save: ${typedError.message}`); } else { - core14.warning(`Failed to save: ${typedError.message}`); + core15.warning(`Failed to save: ${typedError.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); } catch (error3) { - core14.debug(`Failed to delete archive: ${error3}`); + core15.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -99176,7 +99069,7 @@ var require_retry_helper = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RetryHelper = void 0; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var RetryHelper = class { constructor(maxAttempts, minSeconds, maxSeconds) { if (maxAttempts < 1) { @@ -99199,10 +99092,10 @@ var require_retry_helper = __commonJS({ if (isRetryable && !isRetryable(err)) { throw err; } - core14.info(err.message); + core15.info(err.message); } const seconds = this.getSleepAmount(); - core14.info(`Waiting ${seconds} seconds before trying again`); + core15.info(`Waiting ${seconds} seconds before trying again`); yield this.sleep(seconds); attempt++; } @@ -99305,7 +99198,7 @@ var require_tool_cache = __commonJS({ exports2.findFromManifest = findFromManifest; exports2.isExplicitVersion = isExplicitVersion; exports2.evaluateVersions = evaluateVersions; - var core14 = __importStar2(require_core()); + var core15 = __importStar2(require_core()); var io6 = __importStar2(require_io()); var crypto2 = __importStar2(require("crypto")); var fs14 = __importStar2(require("fs")); @@ -99334,8 +99227,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { dest = dest || path13.join(_getTempDirectory(), crypto2.randomUUID()); yield io6.mkdirP(path13.dirname(dest)); - core14.debug(`Downloading ${url2}`); - core14.debug(`Destination ${dest}`); + core15.debug(`Downloading ${url2}`); + core15.debug(`Destination ${dest}`); const maxAttempts = 3; const minSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS", 10); const maxSeconds = _getGlobal("TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS", 20); @@ -99361,7 +99254,7 @@ var require_tool_cache = __commonJS({ allowRetries: false }); if (auth2) { - core14.debug("set auth"); + core15.debug("set auth"); if (headers === void 0) { headers = {}; } @@ -99370,7 +99263,7 @@ var require_tool_cache = __commonJS({ const response = yield http.get(url2, headers); if (response.message.statusCode !== 200) { const err = new HTTPError2(response.message.statusCode); - core14.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + core15.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } const pipeline = util.promisify(stream2.pipeline); @@ -99379,16 +99272,16 @@ var require_tool_cache = __commonJS({ let succeeded = false; try { yield pipeline(readStream, fs14.createWriteStream(dest)); - core14.debug("download complete"); + core15.debug("download complete"); succeeded = true; return dest; } finally { if (!succeeded) { - core14.debug("download failed"); + core15.debug("download failed"); try { yield io6.rmRF(dest); } catch (err) { - core14.debug(`Failed to delete '${dest}'. ${err.message}`); + core15.debug(`Failed to delete '${dest}'. ${err.message}`); } } } @@ -99403,7 +99296,7 @@ var require_tool_cache = __commonJS({ process.chdir(dest); if (_7zPath) { try { - const logLevel = core14.isDebug() ? "-bb1" : "-bb0"; + const logLevel = core15.isDebug() ? "-bb1" : "-bb0"; const args = [ "x", // eXtract files with full paths @@ -99456,7 +99349,7 @@ var require_tool_cache = __commonJS({ throw new Error("parameter 'file' is required"); } dest = yield _createExtractFolder(dest); - core14.debug("Checking tar --version"); + core15.debug("Checking tar --version"); let versionOutput = ""; yield (0, exec_1.exec)("tar --version", [], { ignoreReturnCode: true, @@ -99466,7 +99359,7 @@ var require_tool_cache = __commonJS({ stderr: (data) => versionOutput += data.toString() } }); - core14.debug(versionOutput.trim()); + core15.debug(versionOutput.trim()); const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); let args; if (flags instanceof Array) { @@ -99474,7 +99367,7 @@ var require_tool_cache = __commonJS({ } else { args = [flags]; } - if (core14.isDebug() && !flags.includes("v")) { + if (core15.isDebug() && !flags.includes("v")) { args.push("-v"); } let destArg = dest; @@ -99505,7 +99398,7 @@ var require_tool_cache = __commonJS({ args = [flags]; } args.push("-x", "-C", dest, "-f", file); - if (core14.isDebug()) { + if (core15.isDebug()) { args.push("-v"); } const xarPath = yield io6.which("xar", true); @@ -99548,7 +99441,7 @@ var require_tool_cache = __commonJS({ "-Command", pwshCommand ]; - core14.debug(`Using pwsh at path: ${pwshPath}`); + core15.debug(`Using pwsh at path: ${pwshPath}`); yield (0, exec_1.exec)(`"${pwshPath}"`, args); } else { const powershellCommand = [ @@ -99568,7 +99461,7 @@ var require_tool_cache = __commonJS({ powershellCommand ]; const powershellPath = yield io6.which("powershell", true); - core14.debug(`Using powershell at path: ${powershellPath}`); + core15.debug(`Using powershell at path: ${powershellPath}`); yield (0, exec_1.exec)(`"${powershellPath}"`, args); } }); @@ -99577,7 +99470,7 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { const unzipPath = yield io6.which("unzip", true); const args = [file]; - if (!core14.isDebug()) { + if (!core15.isDebug()) { args.unshift("-q"); } args.unshift("-o"); @@ -99588,8 +99481,8 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os3.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch2}`); - core14.debug(`source dir: ${sourceDir}`); + core15.debug(`Caching tool ${tool} ${version} ${arch2}`); + core15.debug(`source dir: ${sourceDir}`); if (!fs14.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } @@ -99606,14 +99499,14 @@ var require_tool_cache = __commonJS({ return __awaiter2(this, void 0, void 0, function* () { version = semver9.clean(version) || version; arch2 = arch2 || os3.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch2}`); - core14.debug(`source file: ${sourceFile}`); + core15.debug(`Caching tool ${tool} ${version} ${arch2}`); + core15.debug(`source file: ${sourceFile}`); if (!fs14.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } const destFolder = yield _createToolPath(tool, version, arch2); const destPath = path13.join(destFolder, targetFile); - core14.debug(`destination file ${destPath}`); + core15.debug(`destination file ${destPath}`); yield io6.cp(sourceFile, destPath); _completeToolPath(tool, version, arch2); return destFolder; @@ -99636,12 +99529,12 @@ var require_tool_cache = __commonJS({ if (versionSpec) { versionSpec = semver9.clean(versionSpec) || ""; const cachePath = path13.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core14.debug(`checking cache: ${cachePath}`); + core15.debug(`checking cache: ${cachePath}`); if (fs14.existsSync(cachePath) && fs14.existsSync(`${cachePath}.complete`)) { - core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + core15.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); toolPath = cachePath; } else { - core14.debug("not found"); + core15.debug("not found"); } } return toolPath; @@ -99670,7 +99563,7 @@ var require_tool_cache = __commonJS({ const http = new httpm.HttpClient("tool-cache"); const headers = {}; if (auth2) { - core14.debug("set auth"); + core15.debug("set auth"); headers.authorization = auth2; } const response = yield http.getJson(treeUrl, headers); @@ -99691,7 +99584,7 @@ var require_tool_cache = __commonJS({ try { releases = JSON.parse(versionsRaw); } catch (_a) { - core14.debug("Invalid json"); + core15.debug("Invalid json"); } } return releases; @@ -99715,7 +99608,7 @@ var require_tool_cache = __commonJS({ function _createToolPath(tool, version, arch2) { return __awaiter2(this, void 0, void 0, function* () { const folderPath = path13.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); - core14.debug(`destination ${folderPath}`); + core15.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io6.rmRF(folderPath); yield io6.rmRF(markerPath); @@ -99727,18 +99620,18 @@ var require_tool_cache = __commonJS({ const folderPath = path13.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); const markerPath = `${folderPath}.complete`; fs14.writeFileSync(markerPath, ""); - core14.debug("finished caching tool"); + core15.debug("finished caching tool"); } function isExplicitVersion(versionSpec) { const c = semver9.clean(versionSpec) || ""; - core14.debug(`isExplicit: ${c}`); + core15.debug(`isExplicit: ${c}`); const valid3 = semver9.valid(c) != null; - core14.debug(`explicit? ${valid3}`); + core15.debug(`explicit? ${valid3}`); return valid3; } function evaluateVersions(versions, versionSpec) { let version = ""; - core14.debug(`evaluating ${versions.length} versions`); + core15.debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver9.gt(a, b)) { return 1; @@ -99754,9 +99647,9 @@ var require_tool_cache = __commonJS({ } } if (version) { - core14.debug(`matched: ${version}`); + core15.debug(`matched: ${version}`); } else { - core14.debug("match not found"); + core15.debug("match not found"); } return version; } @@ -99940,7 +99833,7 @@ var require_follow_redirects = __commonJS({ if (this._ending) { throw new WriteAfterEndError(); } - if (!isString(data) && !isBuffer(data)) { + if (!isString2(data) && !isBuffer(data)) { throw new TypeError("data should be a string, Buffer or Uint8Array"); } if (isFunction(encoding)) { @@ -100195,7 +100088,7 @@ var require_follow_redirects = __commonJS({ function request2(input, options, callback) { if (isURL(input)) { input = spreadUrlObject(input); - } else if (isString(input)) { + } else if (isString2(input)) { input = spreadUrlObject(parseUrl2(input)); } else { callback = options; @@ -100211,7 +100104,7 @@ var require_follow_redirects = __commonJS({ maxBodyLength: exports3.maxBodyLength }, input, options); options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { + if (!isString2(options.host) && !isString2(options.hostname)) { options.hostname = "::1"; } assert.equal(options.protocol, protocol, "protocol mismatch"); @@ -100238,7 +100131,7 @@ var require_follow_redirects = __commonJS({ parsed = new URL2(input); } else { parsed = validateUrl(url2.parse(input)); - if (!isString(parsed.protocol)) { + if (!isString2(parsed.protocol)) { throw new InvalidUrlError({ input }); } } @@ -100310,11 +100203,11 @@ var require_follow_redirects = __commonJS({ request2.destroy(error3); } function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); + assert(isString2(subdomain) && isString2(domain)); var dot = subdomain.length - domain.length - 1; return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(value) { + function isString2(value) { return typeof value === "string" || value instanceof String; } function isFunction(value) { @@ -103228,7 +103121,7 @@ var require_sarif_schema_2_1_0 = __commonJS({ }); // src/upload-sarif-action.ts -var core13 = __toESM(require_core()); +var core14 = __toESM(require_core()); // src/actions-util.ts var fs2 = __toESM(require("fs")); @@ -105888,6 +105781,16 @@ var safeDump = renamed("safeDump", "dump"); // src/util.ts var semver = __toESM(require_semver2()); + +// src/json/index.ts +function isObject2(value) { + return typeof value === "object" && value !== null && !Array.isArray(value); +} +function isString(value) { + return typeof value === "string"; +} + +// src/util.ts var BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; var BROKEN_VERSIONS = ["0.0.0-20211207"]; var GITHUB_DOTCOM_URL = "https://github.com"; @@ -105978,7 +105881,7 @@ var HTTPError = class extends Error { var ConfigurationError = class extends Error { }; function asHTTPError(arg) { - if (typeof arg !== "object" || arg === null || typeof arg.message !== "string") { + if (!isObject2(arg) || !isString(arg.message)) { return void 0; } if (Number.isInteger(arg.status)) { @@ -106127,7 +106030,6 @@ function unsafeEntriesInvariant(object) { } // src/actions-util.ts -var pkg = require_package(); var getRequiredInput = function(name) { const value = core4.getInput(name); if (!value) { @@ -106144,7 +106046,7 @@ function getTemporaryDirectory() { return value !== void 0 && value !== "" ? value : getRequiredEnvParam("RUNNER_TEMP"); } function getActionVersion() { - return pkg.version; + return "3.33.0"; } function getWorkflowEventName() { return getRequiredEnvParam("GITHUB_EVENT_NAME"); @@ -106465,6 +106367,7 @@ function parseRepositoryNwo(input) { // src/api-client.ts var GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +var DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) { const auth2 = allowExternal && apiDetails.externalRepoAuth || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry); @@ -106479,10 +106382,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false } = {}) error: core5.error }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451] + doNotRetry: DO_NOT_RETRY_STATUSES } }) ); @@ -106855,6 +106755,12 @@ function formatDuration(durationMs) { // src/overlay/index.ts var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +var CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +var CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +var CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB = 7500; var OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_BYTES = OVERLAY_BASE_DATABASE_MAX_UPLOAD_SIZE_MB * 1e6; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -106996,70 +106902,48 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION }, - ["overlay_analysis_actions" /* OverlayAnalysisActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: void 0 - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. ["overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP }, ["overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: void 0 - }, - ["overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: void 0 - }, - ["overlay_analysis_cpp" /* OverlayAnalysisCpp */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_csharp" /* OverlayAnalysisCsharp */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP + }, + ["overlay_analysis_go" /* OverlayAnalysisGo */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO }, ["overlay_analysis_status_check" /* OverlayAnalysisStatusCheck */]: { defaultValue: false, @@ -107071,25 +106955,20 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: void 0 }, - ["overlay_analysis_go" /* OverlayAnalysisGo */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: void 0 - }, ["overlay_analysis_java" /* OverlayAnalysisJava */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA }, ["overlay_analysis_javascript" /* OverlayAnalysisJavascript */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT }, ["overlay_analysis_python" /* OverlayAnalysisPython */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON }, ["overlay_analysis_resource_checks_v2" /* OverlayAnalysisResourceChecksV2 */]: { defaultValue: false, @@ -107099,23 +106978,13 @@ var featureConfig = { ["overlay_analysis_ruby" /* OverlayAnalysisRuby */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: void 0 - }, - ["overlay_analysis_rust" /* OverlayAnalysisRust */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: void 0 + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY }, ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: void 0 }, - ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: void 0 - }, ["python_default_is_to_not_extract_stdlib" /* PythonDefaultIsToNotExtractStdlib */]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -107131,11 +107000,8 @@ var featureConfig = { ["skip_file_coverage_on_prs" /* SkipFileCoverageOnPrs */]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. - minimumVersion: void 0 + minimumVersion: void 0, + toolsFeature: "suppressesMissingFileBaselineWarning" /* SuppressesMissingFileBaselineWarning */ }, ["start_proxy_remove_unused_registries" /* StartProxyRemoveUnusedRegistries */]: { defaultValue: false, @@ -107153,11 +107019,6 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ }, - ["use_repository_properties_v2" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", @@ -107575,6 +107436,7 @@ var semver5 = __toESM(require_semver2()); var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay"; RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries"; + RepositoryPropertyName2["FILE_COVERAGE_ON_PRS"] = "github-codeql-file-coverage-on-prs"; return RepositoryPropertyName2; })(RepositoryPropertyName || {}); var KNOWN_REPOSITORY_PROPERTY_NAMES = new Set( @@ -107681,28 +107543,20 @@ var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB = 14e3; var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_V2_MB * 1e6; var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { - actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, - cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, csharp: "overlay_analysis_csharp" /* OverlayAnalysisCsharp */, go: "overlay_analysis_go" /* OverlayAnalysisGo */, java: "overlay_analysis_java" /* OverlayAnalysisJava */, javascript: "overlay_analysis_javascript" /* OverlayAnalysisJavascript */, python: "overlay_analysis_python" /* OverlayAnalysisPython */, - ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */, - rust: "overlay_analysis_rust" /* OverlayAnalysisRust */, - swift: "overlay_analysis_swift" /* OverlayAnalysisSwift */ + ruby: "overlay_analysis_ruby" /* OverlayAnalysisRuby */ }; var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { - actions: "overlay_analysis_code_scanning_actions" /* OverlayAnalysisCodeScanningActions */, - cpp: "overlay_analysis_code_scanning_cpp" /* OverlayAnalysisCodeScanningCpp */, csharp: "overlay_analysis_code_scanning_csharp" /* OverlayAnalysisCodeScanningCsharp */, go: "overlay_analysis_code_scanning_go" /* OverlayAnalysisCodeScanningGo */, java: "overlay_analysis_code_scanning_java" /* OverlayAnalysisCodeScanningJava */, javascript: "overlay_analysis_code_scanning_javascript" /* OverlayAnalysisCodeScanningJavascript */, python: "overlay_analysis_code_scanning_python" /* OverlayAnalysisCodeScanningPython */, - ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */, - rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, - swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ + ruby: "overlay_analysis_code_scanning_ruby" /* OverlayAnalysisCodeScanningRuby */ }; function getPathToParsedConfigFile(tempDir) { return path7.join(tempDir, "config"); @@ -107960,7 +107814,7 @@ var fs13 = __toESM(require("fs")); var path12 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); -var core12 = __toESM(require_core()); +var core13 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib2()); // src/codeql.ts @@ -110814,7 +110668,7 @@ function locationUpdateCallback(result, location, logger) { } function resolveUriToFile(location, artifacts, sourceRoot, logger) { if (!location.uri && location.index !== void 0) { - if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || typeof artifacts[location.index].location !== "object") { + if (typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || !isObject2(artifacts[location.index].location)) { logger.debug(`Ignoring location as index "${location.index}" is invalid`); return void 0; } @@ -110910,7 +110764,9 @@ async function addFingerprints(sarifLog, sourceRoot, logger) { } // src/init.ts +var core12 = __toESM(require_core()); var toolrunner4 = __toESM(require_toolrunner()); +var github2 = __toESM(require_github()); var io5 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); @@ -110944,10 +110800,7 @@ async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVe // src/upload-lib.ts var GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning."; var GENERIC_404_MSG = "The CodeQL code scanning feature is forbidden on this repository."; -async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) { - if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { - return false; - } +async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects) { return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING; } async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) { @@ -110980,14 +110833,11 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo logger.debug( "Not all SARIF files were produced by CodeQL. Merging files in the action." ); - if (await shouldShowCombineSarifFilesDeprecationWarning( - sarifObjects, - gitHubVersion - )) { + if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects)) { logger.warning( `Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}` ); - core12.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); + core13.exportVariable("CODEQL_MERGE_SARIF_DEPRECATION_WARNING", "true"); } return combineSarifFiles(sarifFiles, logger); } @@ -111086,13 +110936,13 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { if (httpError !== void 0) { switch (httpError.status) { case 403: - core12.warning(httpError.message || GENERIC_403_MSG); + core13.warning(httpError.message || GENERIC_403_MSG); break; case 404: - core12.warning(httpError.message || GENERIC_404_MSG); + core13.warning(httpError.message || GENERIC_404_MSG); break; default: - core12.warning(httpError.message); + core13.warning(httpError.message); break; } } @@ -111479,7 +111329,7 @@ function validateUniqueCategory(sarifLog, sentinelPrefix) { `Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. The easiest fix is to specify a unique value for the \`category\` input. If .runs[].automationDetails.id is specified in the sarif file, that will take precedence over your configured \`category\`. Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})` ); } - core12.exportVariable(sentinelEnvVar, sentinelEnvVar); + core13.exportVariable(sentinelEnvVar, sentinelEnvVar); } } function sanitize(str2) { @@ -111616,11 +111466,11 @@ async function run(startedAt) { } const codeScanningResult = uploadResults["code-scanning" /* CodeScanning */]; if (codeScanningResult !== void 0) { - core13.setOutput("sarif-id", codeScanningResult.sarifID); + core14.setOutput("sarif-id", codeScanningResult.sarifID); } - core13.setOutput("sarif-ids", JSON.stringify(uploadResults)); + core14.setOutput("sarif-ids", JSON.stringify(uploadResults)); if (shouldSkipSarifUpload()) { - core13.debug( + core14.debug( "SARIF upload disabled by an environment variable. Waiting for processing is disabled." ); } else if (getRequiredInput("wait-for-processing") === "true") { @@ -111640,7 +111490,7 @@ async function run(startedAt) { } catch (unwrappedError) { const error3 = isThirdPartyAnalysis("upload-sarif" /* UploadSarif */) && unwrappedError instanceof InvalidSarifUploadError ? new ConfigurationError(unwrappedError.message) : wrapError(unwrappedError); const message = error3.message; - core13.setFailed(message); + core14.setFailed(message); const errorStatusReportBase = await createStatusReportBase( "upload-sarif" /* UploadSarif */, getActionsStatus(error3), @@ -111663,7 +111513,7 @@ async function runWrapper() { try { await run(startedAt); } catch (error3) { - core13.setFailed( + core14.setFailed( `codeql/upload-sarif action failed: ${getErrorMessage(error3)}` ); await sendUnhandledErrorStatusReport( diff --git a/package-lock.json b/package-lock.json index cb957b3b7f..ab118df0e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,16 @@ { "name": "codeql", - "version": "4.32.6", + "version": "4.33.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codeql", - "version": "4.32.6", + "version": "4.33.0", "license": "MIT", + "workspaces": [ + "pr-checks" + ], "dependencies": { "@actions/artifact": "^5.0.3", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", @@ -46,7 +49,7 @@ "@types/sarif": "^2.1.7", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "ava": "^6.4.1", + "ava": "^7.0.0", "esbuild": "^0.27.3", "eslint": "^9.39.2", "eslint-import-resolver-typescript": "^3.8.7", @@ -55,9 +58,9 @@ "eslint-plugin-jsdoc": "^62.7.1", "eslint-plugin-no-async-foreach": "^0.1.1", "glob": "^11.1.0", - "globals": "^17.3.0", + "globals": "^17.4.0", "nock": "^14.0.11", - "sinon": "^21.0.1", + "sinon": "^21.0.2", "typescript": "^5.9.3", "typescript-eslint": "^8.56.1" } @@ -1697,6 +1700,7 @@ "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", "dev": true, + "license": "ISC", "dependencies": { "minipass": "^7.0.4" }, @@ -1705,10 +1709,11 @@ } }, "node_modules/@mapbox/node-pre-gyp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.0.tgz", - "integrity": "sha512-llMXd39jtP0HpQLVI37Bf1m2ADlEb35GYSh1SDSLsBhR+5iCxiNGlT31yqbNtVHygHAtMy6dWFERpU2JgufhPg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-2.0.3.tgz", + "integrity": "sha512-uwPAhccfFJlsfCxMYTwOdVfOz3xqyj8xYL3zJj8f0pb30tLohnnFPhLuqp4/qoEz8sNxe4SESZedcBojRefIzg==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { "consola": "^3.2.3", "detect-libc": "^2.0.0", @@ -2318,10 +2323,11 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.2.0.tgz", - "integrity": "sha512-qWJ2ZTbmumwiLFomfzTyt5Kng4hwPi9rwCYN4SHb6eaRU1KNO4ccxINHr/VhH4GgPlt1XfSTLX2LBTme8ne4Zw==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", + "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", @@ -2339,18 +2345,6 @@ } } }, - "node_modules/@rollup/pluginutils/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", @@ -2404,9 +2398,9 @@ } }, "node_modules/@sinonjs/fake-timers": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.1.0.tgz", - "integrity": "sha512-cqfapCxwTGsrR80FEgOoPsTonoefMBY7dnUEbQ+GRcved0jvkJLzvX6F4WtN+HBqbPX/SiFsIRUp+IrCW/2I2w==", + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-15.1.1.tgz", + "integrity": "sha512-cO5W33JgAPbOh07tvZjUOJ7oWhtaqGHiZw+11DPbyqh2kHTBc3eF/CjJDeQ4205RLQsX6rxCuYOroFQwl7JDRw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -2414,9 +2408,9 @@ } }, "node_modules/@sinonjs/samsam": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.3.tgz", - "integrity": "sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-9.0.2.tgz", + "integrity": "sha512-H/JSxa4GNKZuuU41E3b8Y3tbSEx8y4uq4UH1C56ONQac16HblReJomIvv3Ud7ANQHQmkeSowY49Ij972e/pGxQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -3197,10 +3191,11 @@ ] }, "node_modules/@vercel/nft": { - "version": "0.29.4", - "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-0.29.4.tgz", - "integrity": "sha512-6lLqMNX3TuycBPABycx7A9F1bHQR7kiQln6abjFbPrf5C/05qHM9M5E4PeTE59c7z8g6vHnx1Ioihb2AQl7BTA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@vercel/nft/-/nft-1.3.2.tgz", + "integrity": "sha512-HC8venRc4Ya7vNeBsJneKHHMDDWpQie7VaKhAIOst3MKO+DES+Y/SbzSp8mFkD7OzwAE2HhHkeSuSmwS20mz3A==", "dev": true, + "license": "MIT", "dependencies": { "@mapbox/node-pre-gyp": "^2.0.0", "@rollup/pluginutils": "^5.1.3", @@ -3209,7 +3204,7 @@ "async-sema": "^3.1.1", "bindings": "^1.4.0", "estree-walker": "2.0.2", - "glob": "^10.4.5", + "glob": "^13.0.0", "graceful-fs": "^4.2.9", "node-gyp-build": "^4.2.2", "picomatch": "^4.0.2", @@ -3219,19 +3214,7 @@ "nft": "out/cli.js" }, "engines": { - "node": ">=18" - } - }, - "node_modules/@vercel/nft/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "node": ">=20" } }, "node_modules/abbrev": { @@ -3239,6 +3222,7 @@ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz", "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==", "dev": true, + "license": "ISC", "engines": { "node": "^18.17.0 || >=20.5.0" } @@ -3254,10 +3238,11 @@ } }, "node_modules/acorn": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", - "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -3270,6 +3255,7 @@ "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^8" } @@ -3283,10 +3269,11 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", "dev": true, + "license": "MIT", "dependencies": { "acorn": "^8.11.0" }, @@ -3325,7 +3312,9 @@ } }, "node_modules/ansi-styles": { - "version": "6.2.1", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "license": "MIT", "engines": { "node": ">=12" @@ -3585,60 +3574,61 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-3.1.1.tgz", "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/ava": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/ava/-/ava-6.4.1.tgz", - "integrity": "sha512-vxmPbi1gZx9zhAjHBgw81w/iEDKcrokeRk/fqDTyA2DQygZ0o+dUGRHFOtX8RA5N0heGJTTsIk7+xYxitDb61Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ava/-/ava-7.0.0.tgz", + "integrity": "sha512-4sRJO/gehlfAgSbuH02mClDDiyymnuFmirE3KqPXl2pic1FaFTZaAACKqr85WT4o08iLjViMR9gmMkxzbZ3AgA==", "dev": true, + "license": "MIT", "dependencies": { - "@vercel/nft": "^0.29.4", - "acorn": "^8.15.0", - "acorn-walk": "^8.3.4", - "ansi-styles": "^6.2.1", + "@vercel/nft": "^1.3.2", + "acorn": "^8.16.0", + "acorn-walk": "^8.3.5", + "ansi-styles": "^6.2.3", "arrgv": "^1.0.2", "arrify": "^3.0.0", "callsites": "^4.2.0", - "cbor": "^10.0.9", - "chalk": "^5.4.1", + "cbor": "^10.0.11", + "chalk": "^5.6.2", "chunkd": "^2.0.1", - "ci-info": "^4.3.0", + "ci-info": "^4.4.0", "ci-parallel-vars": "^1.0.1", - "cli-truncate": "^4.0.0", + "cli-truncate": "^5.1.1", "code-excerpt": "^4.0.0", "common-path-prefix": "^3.0.0", "concordance": "^5.0.4", "currently-unhandled": "^0.4.1", - "debug": "^4.4.1", + "debug": "^4.4.3", "emittery": "^1.2.0", "figures": "^6.1.0", - "globby": "^14.1.0", + "globby": "^16.1.1", "ignore-by-default": "^2.1.0", "indent-string": "^5.0.0", "is-plain-object": "^5.0.0", "is-promise": "^4.0.0", - "matcher": "^5.0.0", - "memoize": "^10.1.0", + "matcher": "^6.0.0", + "memoize": "^10.2.0", "ms": "^2.1.3", - "p-map": "^7.0.3", + "p-map": "^7.0.4", "package-config": "^5.0.0", - "picomatch": "^4.0.2", - "plur": "^5.1.0", - "pretty-ms": "^9.2.0", + "picomatch": "^4.0.3", + "plur": "^6.0.0", + "pretty-ms": "^9.3.0", "resolve-cwd": "^3.0.0", "stack-utils": "^2.0.6", - "strip-ansi": "^7.1.0", "supertap": "^3.0.1", "temp-dir": "^3.0.0", - "write-file-atomic": "^6.0.0", - "yargs": "^17.7.2" + "write-file-atomic": "^7.0.0", + "yargs": "^18.0.0" }, "bin": { "ava": "entrypoints/cli.mjs" }, "engines": { - "node": "^18.18 || ^20.8 || ^22 || ^23 || >=24" + "node": "^20.19 || ^22.20 || ^24.12 || >=25" }, "peerDependencies": { "@ava/typescript": "*" @@ -3649,18 +3639,6 @@ } } }, - "node_modules/ava/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, "node_modules/ava/node_modules/callsites": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-4.2.0.tgz", @@ -3673,31 +3651,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ava/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/ava/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "node_modules/ava/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "ms": "^2.1.3" }, "engines": { - "node": ">=12" + "node": ">=6.0" }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, "node_modules/available-typed-arrays": { @@ -3797,6 +3766,7 @@ "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, + "license": "MIT", "dependencies": { "file-uri-to-path": "1.0.0" } @@ -3823,6 +3793,8 @@ }, "node_modules/braces": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "license": "MIT", "dependencies": { @@ -3985,10 +3957,11 @@ "license": "CC-BY-4.0" }, "node_modules/cbor": { - "version": "10.0.9", - "resolved": "https://registry.npmjs.org/cbor/-/cbor-10.0.9.tgz", - "integrity": "sha512-KEWYehb/vJkRmigctVQLsz73Us2RNnITo/wOwQV5AtZpLGH1r2PPlsNHdsX460YuHZCyhLklbYzAOuJfOeg34Q==", + "version": "10.0.12", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-10.0.12.tgz", + "integrity": "sha512-exQDevYd7ZQLP4moMQcZkKCVZsXLAtUSflObr3xTh4xzFIv/xBCdvCd6L259kQOUP2kcTC0jvC6PpZIf/WmRXA==", "dev": true, + "license": "MIT", "dependencies": { "nofilter": "^3.0.2" }, @@ -4009,10 +3982,11 @@ } }, "node_modules/chalk": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", - "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", "dev": true, + "license": "MIT", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -4025,6 +3999,7 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", "dev": true, + "license": "BlueOak-1.0.0", "engines": { "node": ">=18" } @@ -4036,9 +4011,9 @@ "dev": true }, "node_modules/ci-info": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.0.tgz", - "integrity": "sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", + "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", "dev": true, "funding": [ { @@ -4046,6 +4021,7 @@ "url": "https://github.com/sponsors/sibiraj-s" } ], + "license": "MIT", "engines": { "node": ">=8" } @@ -4057,26 +4033,28 @@ "dev": true }, "node_modules/cli-truncate": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", - "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", + "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", "dev": true, + "license": "MIT", "dependencies": { - "slice-ansi": "^5.0.0", - "string-width": "^7.0.0" + "slice-ansi": "^8.0.0", + "string-width": "^8.2.0" }, "engines": { - "node": ">=18" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-truncate/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -4084,36 +4062,31 @@ "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/cli-truncate/node_modules/emoji-regex": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", - "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==", - "dev": true - }, "node_modules/cli-truncate/node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.0.tgz", + "integrity": "sha512-6hJPQ8N0V0P3SNmP6h2J99RLuzrWz2gvT7VnK5tKvrNqJoyS9W4/Fb8mo31UiPvy00z7DQXkP2hnKBVav76thw==", "dev": true, + "license": "MIT", "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" }, "engines": { - "node": ">=18" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-truncate/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^6.2.2" }, "engines": { "node": ">=12" @@ -4123,17 +4096,72 @@ } }, "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", "dev": true, + "license": "ISC", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" }, + "engines": { + "node": ">=20" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/code-excerpt": { @@ -4234,6 +4262,7 @@ "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", "dev": true, + "license": "MIT", "engines": { "node": "^14.18.0 || >=16.10.0" } @@ -4436,18 +4465,19 @@ "license": "ISC" }, "node_modules/detect-libc": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", - "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=8" } }, "node_modules/diff": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.2.tgz", - "integrity": "sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.3.tgz", + "integrity": "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -5543,7 +5573,8 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/esutils": { "version": "2.0.3", @@ -5629,6 +5660,7 @@ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -5721,10 +5753,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fill-range": { "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "license": "MIT", "dependencies": { @@ -5836,6 +5871,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "dev": true, @@ -5890,15 +5940,17 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-east-asian-width": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.3.0.tgz", - "integrity": "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz", + "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -6027,6 +6079,8 @@ }, "node_modules/glob-parent": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "license": "ISC", "dependencies": { @@ -6073,9 +6127,9 @@ } }, "node_modules/globals": { - "version": "17.3.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-17.3.0.tgz", - "integrity": "sha512-yMqGUQVVCkD4tqjOJf3TnrvaaHDMYp4VlUSObbkIiuCPe/ofdMBFIAcBbCSRFWOnos6qRiTVStDwqPLUclaxIw==", + "version": "17.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.4.0.tgz", + "integrity": "sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==", "dev": true, "license": "MIT", "engines": { @@ -6103,47 +6157,60 @@ } }, "node_modules/globby": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-14.1.0.tgz", - "integrity": "sha512-0Ia46fDOaT7k4og1PDW4YbodWWr3scS2vAr2lTbsplOt2WkKp0vQbkI9wKis/T5LV/dqPjO3bpS/z6GTJB82LA==", + "version": "16.1.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-16.1.1.tgz", + "integrity": "sha512-dW7vl+yiAJSp6aCekaVnVJxurRv7DCOLyXqEG3RYMYUg7AuJ2jCqPkZTA8ooqC2vtnkaMcV5WfFBMuEnTu1OQg==", "dev": true, "license": "MIT", "dependencies": { - "@sindresorhus/merge-streams": "^2.1.0", + "@sindresorhus/merge-streams": "^4.0.0", "fast-glob": "^3.3.3", - "ignore": "^7.0.3", - "path-type": "^6.0.0", + "ignore": "^7.0.5", + "is-path-inside": "^4.0.0", "slash": "^5.1.0", - "unicorn-magic": "^0.3.0" + "unicorn-magic": "^0.4.0" }, "engines": { - "node": ">=18" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby/node_modules/@sindresorhus/merge-streams": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", - "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "node_modules/globby/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, "license": "MIT", "engines": { - "node": ">=18" + "node": ">= 4" + } + }, + "node_modules/globby/node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby/node_modules/ignore": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", - "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "node_modules/globby/node_modules/unicorn-magic": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.0.tgz", + "integrity": "sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==", "dev": true, "license": "MIT", "engines": { - "node": ">= 4" + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/gopd": { @@ -6409,12 +6476,16 @@ } }, "node_modules/irregular-plurals": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.5.0.tgz", - "integrity": "sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-4.2.0.tgz", + "integrity": "sha512-bW9UXHL7bnUcNtTo+9ccSngbxc+V40H32IgvdVin0Xs8gbo+AVYD5g/72ce/54Kjfhq66vcZr8H8TKEvsifeOw==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=18.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-array-buffer": { @@ -6657,6 +6728,8 @@ }, "node_modules/is-number": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "license": "MIT", "engines": { @@ -7178,15 +7251,16 @@ } }, "node_modules/matcher": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-5.0.0.tgz", - "integrity": "sha512-s2EMBOWtXFc8dgqvoAzKJXxNHibcdJMV0gwqKUaw9E2JBJuGUK7DrNKrA6g/i+v72TT16+6sVm5mS3thaMLQUw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-6.0.0.tgz", + "integrity": "sha512-TzDerdcNtI79w7Av4GT57bLdElPA/VAkjqdMZv8yhuc8geU2z0ljW9anXbX/55aHEMTpYypZb1lxsA/46r9oOQ==", "dev": true, + "license": "MIT", "dependencies": { "escape-string-regexp": "^5.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -7197,6 +7271,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" }, @@ -7226,10 +7301,11 @@ } }, "node_modules/memoize": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/memoize/-/memoize-10.1.0.tgz", - "integrity": "sha512-MMbFhJzh4Jlg/poq1si90XRlTZRDHVqdlz2mPyGJ6kqMpyHUyVpDd5gpFAvVehW64+RA1eKE9Yt8aSLY7w2Kgg==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/memoize/-/memoize-10.2.0.tgz", + "integrity": "sha512-DeC6b7QBrZsRs3Y02A6A7lQyzFbsQbqgjI6UW0GigGWV+u1s25TycMr0XHZE4cJce7rY/vyw2ctMQqfDkIhUEA==", "dev": true, + "license": "MIT", "dependencies": { "mimic-function": "^5.0.1" }, @@ -7242,6 +7318,8 @@ }, "node_modules/merge2": { "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "license": "MIT", "engines": { @@ -7253,6 +7331,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -7261,11 +7340,25 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mimic-function": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -7369,7 +7462,9 @@ } }, "node_modules/node-fetch": { - "version": "2.6.7", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "license": "MIT", "dependencies": { @@ -7401,6 +7496,7 @@ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", "dev": true, + "license": "MIT", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -7419,6 +7515,7 @@ "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", "dev": true, + "license": "MIT", "engines": { "node": ">=12.19" } @@ -7428,6 +7525,7 @@ "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz", "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==", "dev": true, + "license": "ISC", "dependencies": { "abbrev": "^3.0.0" }, @@ -7654,10 +7752,11 @@ } }, "node_modules/p-map": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz", - "integrity": "sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.4.tgz", + "integrity": "sha512-tkAQEw8ysMzmkhgw8k+1U/iPhWNhykKnSk4Rd5zLoPJCuJaGRPo6YposrZgaxHKzDHdDWWZvE/Sk7hsL2X/CpQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -7765,19 +7864,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-type": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-6.0.0.tgz", - "integrity": "sha512-Vj7sf++t5pBD637NSfkxpHSMfWaeig5+DKWLhcqIYx6mWQz5hdJTGDVMQiJcw1ZYkhs7AazKDGpRVji1LJCZUQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -7786,26 +7872,29 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/plur": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/plur/-/plur-5.1.0.tgz", - "integrity": "sha512-VP/72JeXqak2KiOzjgKtQen5y3IZHn+9GOuLDafPv0eXa47xq0At93XahYBs26MsifCQ4enGKwbjBTKgb9QJXg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/plur/-/plur-6.0.0.tgz", + "integrity": "sha512-Y9wXQivjRX0REtwpA9+n0bYYypWESn3cWtW2vazymw711qn+AQXxzZjRqhANYGBLIMC1UzVdpwe/1hHQwHfwng==", "dev": true, + "license": "MIT", "dependencies": { - "irregular-plurals": "^3.3.0" + "irregular-plurals": "^4.2.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -7821,6 +7910,10 @@ "node": ">= 0.4" } }, + "node_modules/pr-checks": { + "resolved": "pr-checks", + "link": true + }, "node_modules/prelude-ls": { "version": "1.2.1", "dev": true, @@ -7859,10 +7952,11 @@ } }, "node_modules/pretty-ms": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.2.0.tgz", - "integrity": "sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz", + "integrity": "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==", "dev": true, + "license": "MIT", "dependencies": { "parse-ms": "^4.0.0" }, @@ -8017,15 +8111,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/requireindex": { "version": "1.1.0", "dev": true, @@ -8409,16 +8494,16 @@ } }, "node_modules/sinon": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-21.0.1.tgz", - "integrity": "sha512-Z0NVCW45W8Mg5oC/27/+fCqIHFnW8kpkFOq0j9XJIev4Ld0mKmERaZv5DMLAb9fGCevjKwaEeIQz5+MBXfZcDw==", + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-21.0.2.tgz", + "integrity": "sha512-VHV4UaoxIe5jrMd89Y9duI76T5g3Lp+ET+ctLhLDaZtSznDPah1KKpRElbdBV4RwqWSw2vadFiVs9Del7MbVeQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^3.0.1", - "@sinonjs/fake-timers": "^15.1.0", - "@sinonjs/samsam": "^8.0.3", - "diff": "^8.0.2", + "@sinonjs/fake-timers": "^15.1.1", + "@sinonjs/samsam": "^9.0.2", + "diff": "^8.0.3", "supports-color": "^7.2.0" }, "funding": { @@ -8440,28 +8525,33 @@ } }, "node_modules/slice-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", + "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" + "ansi-styles": "^6.2.3", + "is-fullwidth-code-point": "^5.1.0" }, "engines": { - "node": ">=12" + "node": ">=20" }, "funding": { "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -8870,9 +8960,9 @@ } }, "node_modules/tar": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.10.tgz", - "integrity": "sha512-8mOPs1//5q/rlkNSPcCegA6hiHJYDmSLEI8aMH/CdSQJNWztHC9WHNam5zdQlfpTwB9Xp7IBEsHfV5LKMJGVAw==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.11.tgz", + "integrity": "sha512-ChjMH33/KetonMTAtpYdgUFr0tbz69Fp2v7zWxQfYZX4g5ZN2nOBXm1R2xyA+lMIKrLKIoKAwFj93jE/avX9cQ==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -8966,19 +9056,6 @@ } } }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/tmp": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.4.tgz", @@ -8998,6 +9075,8 @@ }, "node_modules/to-regex-range": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9026,6 +9105,8 @@ }, "node_modules/tr46": { "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true, "license": "MIT" }, @@ -9068,6 +9149,26 @@ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/tsx": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", + "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.27.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/tunnel": { "version": "0.0.6", "license": "MIT", @@ -9390,6 +9491,8 @@ }, "node_modules/webidl-conversions": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "dev": true, "license": "BSD-2-Clause" }, @@ -9404,6 +9507,8 @@ }, "node_modules/whatwg-url": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, "license": "MIT", "dependencies": { @@ -9514,17 +9619,18 @@ } }, "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -9563,19 +9669,58 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/wrappy": { @@ -9583,16 +9728,16 @@ "license": "ISC" }, "node_modules/write-file-atomic": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-6.0.0.tgz", - "integrity": "sha512-GmqrO8WJ1NuzJ2DrziEI2o57jKAVIQNf8a18W3nCYU3H7PNWqCCVTeH6/NQE93CIllIgQS98rrmVkYgTX9fFJQ==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-7.0.1.tgz", + "integrity": "sha512-OTIk8iR8/aCRWBqvxrzxR0hgxWpnYBblY1S5hDWBQfk/VFmJwzmJgQFN3WsoUKHISv2eAwe+PpbUzyL1CKTLXg==", "dev": true, + "license": "ISC", "dependencies": { - "imurmurhash": "^0.1.4", "signal-exit": "^4.0.1" }, "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": "^20.17.0 || >=22.9.0" } }, "node_modules/y18n": { @@ -9600,6 +9745,7 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, + "license": "ISC", "engines": { "node": ">=10" } @@ -9609,35 +9755,106 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", "dev": true, + "license": "BlueOak-1.0.0", "engines": { "node": ">=18" } }, + "node_modules/yaml": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", "dev": true, + "license": "MIT", "dependencies": { - "cliui": "^8.0.1", + "cliui": "^9.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", + "string-width": "^7.2.0", "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" + "yargs-parser": "^22.0.0" }, "engines": { - "node": ">=12" + "node": "^20.19.0 || ^22.12.0 || >=23" } }, "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/yocto-queue": { @@ -9678,6 +9895,16 @@ "engines": { "node": ">= 14" } + }, + "pr-checks": { + "dependencies": { + "yaml": "^2.8.2" + }, + "devDependencies": { + "@types/node": "^20.19.9", + "tsx": "^4.21.0", + "typescript": "^5.9.3" + } } } } diff --git a/package.json b/package.json index 4a5ecb60cd..1a1044a7b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeql", - "version": "3.32.6", + "version": "3.33.0", "private": true, "description": "CodeQL action", "scripts": { @@ -14,15 +14,10 @@ "test-debug": "npm run test -- --timeout=20m", "transpile": "tsc --build --verbose" }, - "ava": { - "typescript": { - "rewritePaths": { - "src/": "build/" - }, - "compile": false - } - }, "license": "MIT", + "workspaces": [ + "pr-checks" + ], "dependencies": { "@actions/artifact": "^5.0.3", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", @@ -61,7 +56,7 @@ "@types/sarif": "^2.1.7", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", - "ava": "^6.4.1", + "ava": "^7.0.0", "esbuild": "^0.27.3", "eslint": "^9.39.2", "eslint-import-resolver-typescript": "^3.8.7", @@ -70,9 +65,9 @@ "eslint-plugin-jsdoc": "^62.7.1", "eslint-plugin-no-async-foreach": "^0.1.1", "glob": "^11.1.0", - "globals": "^17.3.0", + "globals": "^17.4.0", "nock": "^14.0.11", - "sinon": "^21.0.1", + "sinon": "^21.0.2", "typescript": "^5.9.3", "typescript-eslint": "^8.56.1" }, diff --git a/pr-checks/checks/all-platform-bundle.yml b/pr-checks/checks/all-platform-bundle.yml index 994c91eb97..d35620706f 100644 --- a/pr-checks/checks/all-platform-bundle.yml +++ b/pr-checks/checks/all-platform-bundle.yml @@ -1,7 +1,11 @@ name: "All-platform bundle" description: "Tests using an all-platform CodeQL Bundle" -operatingSystems: ["ubuntu", "macos", "windows"] -versions: ["nightly-latest"] +operatingSystems: + - ubuntu + - macos + - windows +versions: + - nightly-latest useAllPlatformBundle: "true" installGo: true installDotNet: true diff --git a/pr-checks/checks/analysis-kinds.yml b/pr-checks/checks/analysis-kinds.yml index 1fed310539..7b10f8d792 100644 --- a/pr-checks/checks/analysis-kinds.yml +++ b/pr-checks/checks/analysis-kinds.yml @@ -1,7 +1,13 @@ name: "Analysis kinds" description: "Tests basic functionality for different `analysis-kinds` inputs." -versions: ["linked", "nightly-latest"] -analysisKinds: ["code-scanning", "code-quality", "code-scanning,code-quality", "risk-assessment"] +versions: + - linked + - nightly-latest +analysisKinds: + - code-scanning + - code-quality + - code-scanning,code-quality + - risk-assessment env: CODEQL_ACTION_RISK_ASSESSMENT_ID: 1 CHECK_SCRIPT: | diff --git a/pr-checks/checks/analyze-ref-input.yml b/pr-checks/checks/analyze-ref-input.yml index e9d2cd1764..683d40df9f 100644 --- a/pr-checks/checks/analyze-ref-input.yml +++ b/pr-checks/checks/analyze-ref-input.yml @@ -1,8 +1,8 @@ name: "Analyze: 'ref' and 'sha' from inputs" description: "Checks that specifying 'ref' and 'sha' as inputs works" -versions: ["default"] +versions: + - default installGo: true -installPython: true installDotNet: true steps: - uses: ./../action/init diff --git a/pr-checks/checks/autobuild-action.yml b/pr-checks/checks/autobuild-action.yml index b91489cc8c..d46204c89d 100644 --- a/pr-checks/checks/autobuild-action.yml +++ b/pr-checks/checks/autobuild-action.yml @@ -1,7 +1,11 @@ name: "autobuild-action" description: "Tests that the C# autobuild action works" -operatingSystems: ["ubuntu", "macos", "windows"] -versions: ["linked"] +operatingSystems: + - ubuntu + - macos + - windows +versions: + - linked installDotNet: true steps: - uses: ./../action/init diff --git a/pr-checks/checks/autobuild-direct-tracing-with-working-dir.yml b/pr-checks/checks/autobuild-direct-tracing-with-working-dir.yml index f492ac85a4..0956b34479 100644 --- a/pr-checks/checks/autobuild-direct-tracing-with-working-dir.yml +++ b/pr-checks/checks/autobuild-direct-tracing-with-working-dir.yml @@ -3,8 +3,12 @@ description: > An end-to-end integration test of a Java repository built using 'build-mode: autobuild', with direct tracing enabled and a custom working directory specified as the input to the autobuild Action. -operatingSystems: ["ubuntu", "windows"] -versions: ["linked", "nightly-latest"] +operatingSystems: + - ubuntu + - windows +versions: + - linked + - nightly-latest installJava: true env: CODEQL_ACTION_AUTOBUILD_BUILD_MODE_DIRECT_TRACING: true diff --git a/pr-checks/checks/autobuild-working-dir.yml b/pr-checks/checks/autobuild-working-dir.yml index 77c1f73c84..5feee38f71 100644 --- a/pr-checks/checks/autobuild-working-dir.yml +++ b/pr-checks/checks/autobuild-working-dir.yml @@ -1,6 +1,7 @@ name: "Autobuild working directory" description: "Tests working-directory input of autobuild action" -versions: ["linked"] +versions: + - linked steps: - name: Test setup run: | diff --git a/pr-checks/checks/build-mode-autobuild.yml b/pr-checks/checks/build-mode-autobuild.yml index 0fc260f7bd..56845f0633 100644 --- a/pr-checks/checks/build-mode-autobuild.yml +++ b/pr-checks/checks/build-mode-autobuild.yml @@ -1,7 +1,11 @@ name: "Build mode autobuild" description: "An end-to-end integration test of a Java repository built using 'build-mode: autobuild'" -operatingSystems: ["ubuntu", "windows"] -versions: ["linked", "nightly-latest"] +operatingSystems: + - ubuntu + - windows +versions: + - linked + - nightly-latest installJava: true installYq: true steps: diff --git a/pr-checks/checks/build-mode-manual.yml b/pr-checks/checks/build-mode-manual.yml index a8048230c8..2d7a44bdc0 100644 --- a/pr-checks/checks/build-mode-manual.yml +++ b/pr-checks/checks/build-mode-manual.yml @@ -1,6 +1,7 @@ name: "Build mode manual" description: "An end-to-end integration test of a Java repository built using 'build-mode: manual'" -versions: ["nightly-latest"] +versions: + - nightly-latest installGo: true installDotNet: true steps: diff --git a/pr-checks/checks/build-mode-none.yml b/pr-checks/checks/build-mode-none.yml index 669ea7915e..f35dbc2a53 100644 --- a/pr-checks/checks/build-mode-none.yml +++ b/pr-checks/checks/build-mode-none.yml @@ -1,6 +1,8 @@ name: "Build mode none" description: "An end-to-end integration test of a Java repository built using 'build-mode: none'" -versions: ["linked", "nightly-latest"] +versions: + - linked + - nightly-latest steps: - uses: ./../action/init id: init diff --git a/pr-checks/checks/build-mode-rollback.yml b/pr-checks/checks/build-mode-rollback.yml index 49bcfdd1f0..cfb4dfa224 100644 --- a/pr-checks/checks/build-mode-rollback.yml +++ b/pr-checks/checks/build-mode-rollback.yml @@ -1,6 +1,7 @@ name: "Build mode rollback" description: "The build mode is rolled back from none to autobuild when the relevant feature flag is enabled." -versions: ["nightly-latest"] +versions: + - nightly-latest env: CODEQL_ACTION_DISABLE_JAVA_BUILDLESS: true steps: diff --git a/pr-checks/checks/bundle-toolcache.yml b/pr-checks/checks/bundle-toolcache.yml index eb196419ee..f5315d285a 100644 --- a/pr-checks/checks/bundle-toolcache.yml +++ b/pr-checks/checks/bundle-toolcache.yml @@ -3,8 +3,8 @@ description: "The CodeQL bundle should be cached within the toolcache" versions: - linked operatingSystems: - - macos - ubuntu + - macos - windows steps: - name: Remove CodeQL from toolcache diff --git a/pr-checks/checks/bundle-zstd.yml b/pr-checks/checks/bundle-zstd.yml index 0023345233..810f0b0c12 100644 --- a/pr-checks/checks/bundle-zstd.yml +++ b/pr-checks/checks/bundle-zstd.yml @@ -3,8 +3,8 @@ description: "A Zstandard CodeQL bundle should be extracted on supported operati versions: - linked operatingSystems: - - macos - ubuntu + - macos - windows steps: - name: Remove CodeQL from toolcache diff --git a/pr-checks/checks/cleanup-db-cluster-dir.yml b/pr-checks/checks/cleanup-db-cluster-dir.yml index d2cacf47eb..15124fd53f 100644 --- a/pr-checks/checks/cleanup-db-cluster-dir.yml +++ b/pr-checks/checks/cleanup-db-cluster-dir.yml @@ -1,6 +1,7 @@ name: "Clean up database cluster directory" description: "The database cluster directory is cleaned up if it is not empty." -versions: ["linked"] +versions: + - linked steps: - name: Add a file to the database cluster directory run: | diff --git a/pr-checks/checks/config-export.yml b/pr-checks/checks/config-export.yml index ea66ad994f..17dd758453 100644 --- a/pr-checks/checks/config-export.yml +++ b/pr-checks/checks/config-export.yml @@ -1,6 +1,8 @@ name: "Config export" description: "Tests that the code scanning configuration file is exported to SARIF correctly." -versions: ["linked", "nightly-latest"] +versions: + - linked + - nightly-latest steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/config-input.yml b/pr-checks/checks/config-input.yml index f139ff90e6..d4dab66295 100644 --- a/pr-checks/checks/config-input.yml +++ b/pr-checks/checks/config-input.yml @@ -1,7 +1,8 @@ name: "Config input" description: "Tests specifying configuration using the config input" installNode: true -versions: ["linked"] +versions: + - linked steps: - name: Copy queries into workspace run: | diff --git a/pr-checks/checks/cpp-deptrace-disabled.yml b/pr-checks/checks/cpp-deptrace-disabled.yml index 5b6e82726a..7eaddd8529 100644 --- a/pr-checks/checks/cpp-deptrace-disabled.yml +++ b/pr-checks/checks/cpp-deptrace-disabled.yml @@ -1,6 +1,9 @@ name: "C/C++: disabling autoinstalling dependencies (Linux)" description: "Checks that running C/C++ autobuild with autoinstalling dependencies explicitly disabled works" -versions: ["linked", "default", "nightly-latest"] +versions: + - linked + - default + - nightly-latest env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: diff --git a/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml b/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml index 7180be1724..5765fb002c 100644 --- a/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml +++ b/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml @@ -1,7 +1,10 @@ name: "C/C++: autoinstalling dependencies is skipped (macOS)" description: "Checks that running C/C++ autobuild with autoinstalling dependencies explicitly enabled is a no-op on macOS" -operatingSystems: ["macos"] -versions: ["linked", "nightly-latest"] +operatingSystems: + - macos +versions: + - linked + - nightly-latest env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: diff --git a/pr-checks/checks/cpp-deptrace-enabled.yml b/pr-checks/checks/cpp-deptrace-enabled.yml index e35910a756..7a522ae86f 100644 --- a/pr-checks/checks/cpp-deptrace-enabled.yml +++ b/pr-checks/checks/cpp-deptrace-enabled.yml @@ -1,6 +1,9 @@ name: "C/C++: autoinstalling dependencies (Linux)" description: "Checks that running C/C++ autobuild with autoinstalling dependencies works" -versions: ["linked", "default", "nightly-latest"] +versions: + - linked + - default + - nightly-latest env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: diff --git a/pr-checks/checks/diagnostics-export.yml b/pr-checks/checks/diagnostics-export.yml index 1b26969371..811335a7c7 100644 --- a/pr-checks/checks/diagnostics-export.yml +++ b/pr-checks/checks/diagnostics-export.yml @@ -1,6 +1,8 @@ name: "Diagnostic export" description: "Tests that manually added diagnostics are correctly exported to SARIF." -versions: ["linked", "nightly-latest"] +versions: + - linked + - nightly-latest env: CODEQL_ACTION_EXPORT_DIAGNOSTICS: true steps: diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 114aa8c437..8f882ef598 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -1,7 +1,11 @@ name: "Export file baseline information" description: "Tests that file baseline information is exported when the feature is enabled" -operatingSystems: ["ubuntu", "macos", "windows"] -versions: ["nightly-latest"] +operatingSystems: + - ubuntu + - macos + - windows +versions: + - nightly-latest installGo: true installDotNet: true env: diff --git a/pr-checks/checks/extractor-ram-threads.yml b/pr-checks/checks/extractor-ram-threads.yml index 43638af180..17ed1998ef 100644 --- a/pr-checks/checks/extractor-ram-threads.yml +++ b/pr-checks/checks/extractor-ram-threads.yml @@ -1,6 +1,7 @@ name: "Extractor ram and threads options test" description: "Tests passing RAM and threads limits to extractors" -versions: ["linked"] +versions: + - linked steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/global-proxy.yml b/pr-checks/checks/global-proxy.yml index 0bcb0ce319..5f90022c04 100644 --- a/pr-checks/checks/global-proxy.yml +++ b/pr-checks/checks/global-proxy.yml @@ -1,6 +1,8 @@ name: "Proxy test" description: "Tests using a proxy specified by the https_proxy environment variable" -versions: ["linked", "nightly-latest"] +versions: + - linked + - nightly-latest container: image: ubuntu:22.04 services: diff --git a/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml b/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml index 10acfeb439..bd48f1a12c 100644 --- a/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml +++ b/pr-checks/checks/go-indirect-tracing-workaround-diagnostic.yml @@ -2,7 +2,8 @@ name: "Go: diagnostic when Go is changed after init step" description: "Checks that we emit a diagnostic if Go is changed after the init step" # only Linux is affected # pinned to a version which does not support statically linked binaries for indirect tracing -versions: ["default"] +versions: + - default installGo: true collection: go steps: diff --git a/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml b/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml index c5083b6015..8e3f4234b5 100644 --- a/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml +++ b/pr-checks/checks/go-indirect-tracing-workaround-no-file-program.yml @@ -2,7 +2,8 @@ name: "Go: diagnostic when `file` is not installed" description: "Checks that we emit a diagnostic if the `file` program is not installed" # only Linux is affected # pinned to a version which does not support statically linked binaries for indirect tracing -versions: ["default"] +versions: + - default installGo: true collection: go steps: diff --git a/pr-checks/checks/go-indirect-tracing-workaround.yml b/pr-checks/checks/go-indirect-tracing-workaround.yml index 222b964c78..0856e8cf58 100644 --- a/pr-checks/checks/go-indirect-tracing-workaround.yml +++ b/pr-checks/checks/go-indirect-tracing-workaround.yml @@ -2,7 +2,8 @@ name: "Go: workaround for indirect tracing" description: "Checks that our workaround for indirect tracing for Go 1.21+ on Linux works" # only Linux is affected # pinned to a version which does not support statically linked binaries for indirect tracing -versions: ["default"] +versions: + - default installGo: true collection: go steps: diff --git a/pr-checks/checks/go-tracing-autobuilder.yml b/pr-checks/checks/go-tracing-autobuilder.yml index d6860bce02..c454fc27eb 100644 --- a/pr-checks/checks/go-tracing-autobuilder.yml +++ b/pr-checks/checks/go-tracing-autobuilder.yml @@ -1,7 +1,13 @@ name: "Go: tracing with autobuilder step" description: "Checks that Go tracing works when using an autobuilder step" collection: go -operatingSystems: ["ubuntu", "macos"] +operatingSystems: + - ubuntu + - macos +osCodeQlVersions: + macos: + - linked + - nightly-latest env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" installGo: true diff --git a/pr-checks/checks/go-tracing-custom-build-steps.yml b/pr-checks/checks/go-tracing-custom-build-steps.yml index 9ddc8a87dc..31c4f27c33 100644 --- a/pr-checks/checks/go-tracing-custom-build-steps.yml +++ b/pr-checks/checks/go-tracing-custom-build-steps.yml @@ -1,7 +1,13 @@ name: "Go: tracing with custom build steps" description: "Checks that Go tracing traces the build when using custom build steps" collection: go -operatingSystems: ["ubuntu", "macos"] +operatingSystems: + - ubuntu + - macos +osCodeQlVersions: + macos: + - linked + - nightly-latest installGo: true steps: - uses: ./../action/init diff --git a/pr-checks/checks/go-tracing-legacy-workflow.yml b/pr-checks/checks/go-tracing-legacy-workflow.yml index a6b0da17d4..5431fac0f9 100644 --- a/pr-checks/checks/go-tracing-legacy-workflow.yml +++ b/pr-checks/checks/go-tracing-legacy-workflow.yml @@ -1,7 +1,13 @@ name: "Go: tracing with legacy workflow" description: "Checks that we run the autobuilder in legacy workflows with neither an autobuild step nor manual build steps" collection: go -operatingSystems: ["ubuntu", "macos"] +operatingSystems: + - ubuntu + - macos +osCodeQlVersions: + macos: + - linked + - nightly-latest env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" installGo: true diff --git a/pr-checks/checks/init-with-registries.yml b/pr-checks/checks/init-with-registries.yml index cedc62aab0..69e2188de2 100644 --- a/pr-checks/checks/init-with-registries.yml +++ b/pr-checks/checks/init-with-registries.yml @@ -4,12 +4,11 @@ # basic mechanics of multi-registry auth is working. name: "Packaging: Download using registries" description: "Checks that specifying a registries block and associated auth works as expected" -versions: [ - # This feature is not compatible with older CLIs - "default", - "linked", - "nightly-latest", -] +versions: + # This feature is not compatible with older CLIs + - default + - linked + - nightly-latest permissions: contents: read diff --git a/pr-checks/checks/javascript-source-root.yml b/pr-checks/checks/javascript-source-root.yml index b06dc7bfa2..c814e77e4f 100644 --- a/pr-checks/checks/javascript-source-root.yml +++ b/pr-checks/checks/javascript-source-root.yml @@ -1,6 +1,10 @@ name: "Custom source root" description: "Checks that the argument specifying a non-default source root works" -versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs +# This feature is not compatible with old CLIs +versions: + - linked + - default + - nightly-latest steps: - name: Move codeql-action run: | diff --git a/pr-checks/checks/job-run-uuid-sarif.yml b/pr-checks/checks/job-run-uuid-sarif.yml index 815d880004..b37821d5a1 100644 --- a/pr-checks/checks/job-run-uuid-sarif.yml +++ b/pr-checks/checks/job-run-uuid-sarif.yml @@ -1,6 +1,7 @@ name: "Job run UUID added to SARIF" description: "Tests that the job run UUID is added to the SARIF output" -versions: ["nightly-latest"] +versions: + - nightly-latest steps: - uses: ./../action/init id: init diff --git a/pr-checks/checks/language-aliases.yml b/pr-checks/checks/language-aliases.yml index b0db1288a3..8fcde341d0 100644 --- a/pr-checks/checks/language-aliases.yml +++ b/pr-checks/checks/language-aliases.yml @@ -1,6 +1,7 @@ name: "Language aliases" description: "Tests that language aliases are resolved correctly" -versions: ["linked"] +versions: + - linked steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/local-bundle.yml b/pr-checks/checks/local-bundle.yml index c0930772e6..52e3ff552d 100644 --- a/pr-checks/checks/local-bundle.yml +++ b/pr-checks/checks/local-bundle.yml @@ -1,8 +1,8 @@ name: "Local CodeQL bundle" description: "Tests using a CodeQL bundle from a local file rather than a URL" -versions: ["linked"] +versions: + - linked installGo: true -installPython: true installDotNet: true steps: - name: Fetch latest CodeQL bundle diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 4892bcc316..e005a9239d 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -1,12 +1,21 @@ name: "Multi-language repository" -description: "An end-to-end integration test of a multi-language repository using automatic language detection for macOS" -operatingSystems: ["macos", "ubuntu"] +description: "An end-to-end integration test of a multi-language repository using automatic language detection" +operatingSystems: + - ubuntu + - macos env: CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI: true installGo: true -installPython: true installDotNet: true steps: + - name: Install Python 3.13 for older CLI versions + # We need Python 3.13 for older CLI versions because they are not compatible with Python 3.14 or newer. + # See https://github.com/github/codeql-action/pull/3212 + if: matrix.version != 'nightly-latest' && matrix.version != 'linked' + uses: actions/setup-python@v6 + with: + python-version: "3.13" + - name: Use Xcode 16 if: runner.os == 'macOS' && matrix.version != 'nightly-latest' run: sudo xcode-select -s "/Applications/Xcode_16.app" diff --git a/pr-checks/checks/overlay-init-fallback.yml b/pr-checks/checks/overlay-init-fallback.yml index bfcfd27e79..26d8c85672 100644 --- a/pr-checks/checks/overlay-init-fallback.yml +++ b/pr-checks/checks/overlay-init-fallback.yml @@ -1,6 +1,8 @@ name: "Overlay database init fallback" description: "Tests that overlay init action succeeds with non-overlay packs" -versions: ["linked", "nightly-latest"] +versions: + - linked + - nightly-latest steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/packaging-codescanning-config-inputs-js.yml b/pr-checks/checks/packaging-codescanning-config-inputs-js.yml index 6fd0f7c8a1..aadce0662d 100644 --- a/pr-checks/checks/packaging-codescanning-config-inputs-js.yml +++ b/pr-checks/checks/packaging-codescanning-config-inputs-js.yml @@ -1,9 +1,12 @@ name: "Packaging: Config and input passed to the CLI" description: "Checks that specifying packages using a combination of a config file and input to the Action works" -versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs +# This feature is not compatible with old CLIs +versions: + - linked + - default + - nightly-latest installGo: true installNode: true -installPython: true installDotNet: true steps: - uses: ./../action/init diff --git a/pr-checks/checks/packaging-config-inputs-js.yml b/pr-checks/checks/packaging-config-inputs-js.yml index 8df42f9443..9d0ed13757 100644 --- a/pr-checks/checks/packaging-config-inputs-js.yml +++ b/pr-checks/checks/packaging-config-inputs-js.yml @@ -1,6 +1,10 @@ name: "Packaging: Config and input" description: "Checks that specifying packages using a combination of a config file and input to the Action works" -versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs +# This feature is not compatible with old CLIs +versions: + - linked + - default + - nightly-latest installGo: true installNode: true installDotNet: true diff --git a/pr-checks/checks/packaging-config-js.yml b/pr-checks/checks/packaging-config-js.yml index 9fa41061ce..d10a21f86a 100644 --- a/pr-checks/checks/packaging-config-js.yml +++ b/pr-checks/checks/packaging-config-js.yml @@ -1,6 +1,10 @@ name: "Packaging: Config file" description: "Checks that specifying packages using only a config file works" -versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs +# This feature is not compatible with old CLIs +versions: + - linked + - default + - nightly-latest installGo: true installNode: true installDotNet: true diff --git a/pr-checks/checks/packaging-inputs-js.yml b/pr-checks/checks/packaging-inputs-js.yml index bb70de7e61..c3adbaaa1c 100644 --- a/pr-checks/checks/packaging-inputs-js.yml +++ b/pr-checks/checks/packaging-inputs-js.yml @@ -1,6 +1,10 @@ name: "Packaging: Action input" description: "Checks that specifying packages using the input to the Action works" -versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs +# This feature is not compatible with old CLIs +versions: + - linked + - default + - nightly-latest installGo: true installNode: true installDotNet: true diff --git a/pr-checks/checks/remote-config.yml b/pr-checks/checks/remote-config.yml index 24249156ea..9211cb2128 100644 --- a/pr-checks/checks/remote-config.yml +++ b/pr-checks/checks/remote-config.yml @@ -6,7 +6,6 @@ versions: - linked - nightly-latest installGo: true -installPython: true installDotNet: true steps: - uses: ./../action/init diff --git a/pr-checks/checks/resolve-environment-action.yml b/pr-checks/checks/resolve-environment-action.yml index 9722b72285..4ea1bfad41 100644 --- a/pr-checks/checks/resolve-environment-action.yml +++ b/pr-checks/checks/resolve-environment-action.yml @@ -1,6 +1,9 @@ name: "Resolve environment" description: "Tests that the resolve-environment action works for Go and JavaScript/TypeScript" -versions: ["default", "linked", "nightly-latest"] +versions: + - linked + - default + - nightly-latest steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/rubocop-multi-language.yml b/pr-checks/checks/rubocop-multi-language.yml index e88ddbedaa..a6e7ad8601 100644 --- a/pr-checks/checks/rubocop-multi-language.yml +++ b/pr-checks/checks/rubocop-multi-language.yml @@ -1,7 +1,8 @@ name: "RuboCop multi-language" description: "Tests using RuboCop to analyze a multi-language repository and then using the CodeQL Action to upload the resulting SARIF" # This check doesn't use CodeQL, so the `version` matrix variable is unused. -versions: ["default"] +versions: + - default steps: - name: Set up Ruby uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.0 diff --git a/pr-checks/checks/ruby.yml b/pr-checks/checks/ruby.yml index e6208755d9..fe061c085c 100644 --- a/pr-checks/checks/ruby.yml +++ b/pr-checks/checks/ruby.yml @@ -1,7 +1,12 @@ name: "Ruby analysis" description: "Tests creation of a Ruby database" -versions: ["linked", "default", "nightly-latest"] -operatingSystems: ["ubuntu", "macos"] +versions: + - linked + - default + - nightly-latest +operatingSystems: + - ubuntu + - macos steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/split-workflow.yml b/pr-checks/checks/split-workflow.yml index 23f82a7a5b..4f7128c857 100644 --- a/pr-checks/checks/split-workflow.yml +++ b/pr-checks/checks/split-workflow.yml @@ -1,7 +1,13 @@ name: "Split workflow" description: "Tests a split-up workflow in which we first build a database and later analyze it" -operatingSystems: ["ubuntu", "macos"] -versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs +operatingSystems: + - ubuntu + - macos +# This feature is not compatible with old CLIs +versions: + - linked + - default + - nightly-latest installGo: true installDotNet: true steps: diff --git a/pr-checks/checks/start-proxy.yml b/pr-checks/checks/start-proxy.yml index b918b7a63f..acd6417fbb 100644 --- a/pr-checks/checks/start-proxy.yml +++ b/pr-checks/checks/start-proxy.yml @@ -1,7 +1,11 @@ name: "Start proxy" description: "Tests that the proxy can be initialised on all platforms" -operatingSystems: ["ubuntu", "macos", "windows"] -versions: ["linked"] +operatingSystems: + - ubuntu + - macos + - windows +versions: + - linked steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/submit-sarif-failure.yml b/pr-checks/checks/submit-sarif-failure.yml index 5db63bb813..e776e23c24 100644 --- a/pr-checks/checks/submit-sarif-failure.yml +++ b/pr-checks/checks/submit-sarif-failure.yml @@ -1,6 +1,9 @@ name: Submit SARIF after failure description: Check that a SARIF file is submitted for the workflow run if it fails -versions: ["linked", "default", "nightly-latest"] +versions: + - linked + - default + - nightly-latest env: # Internal-only environment variable used to indicate that the post-init Action diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index a9880149b4..e9949c12e7 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -1,7 +1,9 @@ name: "Swift analysis using autobuild" description: "Tests creation of a Swift database using autobuild" -versions: ["nightly-latest"] -operatingSystems: ["macos"] +versions: + - nightly-latest +operatingSystems: + - macos steps: - uses: ./../action/init id: init diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 1c8f1bf3af..7a07d5b7e2 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -1,7 +1,11 @@ name: "Swift analysis using a custom build command" description: "Tests creation of a Swift database using custom build" -versions: ["linked", "default", "nightly-latest"] -operatingSystems: ["macos"] +versions: + - linked + - default + - nightly-latest +operatingSystems: + - macos installGo: true installDotNet: true env: diff --git a/pr-checks/checks/unset-environment.yml b/pr-checks/checks/unset-environment.yml index 4cc728600a..dd41f159b5 100644 --- a/pr-checks/checks/unset-environment.yml +++ b/pr-checks/checks/unset-environment.yml @@ -6,7 +6,6 @@ versions: - linked - nightly-latest installGo: true -installPython: true installDotNet: true steps: - uses: ./../action/init diff --git a/pr-checks/checks/upload-ref-sha-input.yml b/pr-checks/checks/upload-ref-sha-input.yml index 0c8059a515..9700827151 100644 --- a/pr-checks/checks/upload-ref-sha-input.yml +++ b/pr-checks/checks/upload-ref-sha-input.yml @@ -1,8 +1,8 @@ name: "Upload-sarif: 'ref' and 'sha' from inputs" description: "Checks that specifying 'ref' and 'sha' as inputs works" -versions: ["default"] +versions: + - default installGo: true -installPython: true installDotNet: true steps: - uses: ./../action/init diff --git a/pr-checks/checks/upload-sarif.yml b/pr-checks/checks/upload-sarif.yml index 8009225c2e..8056a5179c 100644 --- a/pr-checks/checks/upload-sarif.yml +++ b/pr-checks/checks/upload-sarif.yml @@ -1,9 +1,12 @@ name: "Test different uses of `upload-sarif`" description: "Checks that uploading SARIFs to the code quality endpoint works" -versions: ["default"] -analysisKinds: ["code-scanning", "code-quality", "code-scanning,code-quality"] +versions: + - default +analysisKinds: + - code-scanning + - code-quality + - code-scanning,code-quality installGo: true -installPython: true installDotNet: true steps: - uses: ./../action/init diff --git a/pr-checks/checks/with-checkout-path.yml b/pr-checks/checks/with-checkout-path.yml index 230e342e30..c53e3b4153 100644 --- a/pr-checks/checks/with-checkout-path.yml +++ b/pr-checks/checks/with-checkout-path.yml @@ -1,8 +1,8 @@ name: "Use a custom `checkout_path`" description: "Checks that a custom `checkout_path` will find the proper commit_oid" -versions: ["linked"] +versions: + - linked installGo: true -installPython: true installDotNet: true steps: # This ensures we don't accidentally use the original checkout for any part of the test. diff --git a/pr-checks/package-lock.json b/pr-checks/package-lock.json deleted file mode 100644 index 2facb73229..0000000000 --- a/pr-checks/package-lock.json +++ /dev/null @@ -1,605 +0,0 @@ -{ - "name": "pr-checks", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "yaml": "^2.8.2" - }, - "devDependencies": { - "@types/node": "^20.19.9", - "tsx": "^4.21.0", - "typescript": "^5.9.3" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", - "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", - "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", - "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", - "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", - "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", - "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", - "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", - "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", - "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", - "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", - "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", - "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", - "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", - "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", - "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", - "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", - "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", - "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", - "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", - "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", - "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", - "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", - "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", - "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", - "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", - "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@types/node": { - "version": "20.19.35", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.35.tgz", - "integrity": "sha512-Uarfe6J91b9HAUXxjvSOdiO2UPOKLm07Q1oh0JHxoZ1y8HoqxDAu3gVrsrOHeiio0kSsoVBt4wFrKOm0dKxVPQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~6.21.0" - } - }, - "node_modules/esbuild": { - "version": "0.27.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", - "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.3", - "@esbuild/android-arm": "0.27.3", - "@esbuild/android-arm64": "0.27.3", - "@esbuild/android-x64": "0.27.3", - "@esbuild/darwin-arm64": "0.27.3", - "@esbuild/darwin-x64": "0.27.3", - "@esbuild/freebsd-arm64": "0.27.3", - "@esbuild/freebsd-x64": "0.27.3", - "@esbuild/linux-arm": "0.27.3", - "@esbuild/linux-arm64": "0.27.3", - "@esbuild/linux-ia32": "0.27.3", - "@esbuild/linux-loong64": "0.27.3", - "@esbuild/linux-mips64el": "0.27.3", - "@esbuild/linux-ppc64": "0.27.3", - "@esbuild/linux-riscv64": "0.27.3", - "@esbuild/linux-s390x": "0.27.3", - "@esbuild/linux-x64": "0.27.3", - "@esbuild/netbsd-arm64": "0.27.3", - "@esbuild/netbsd-x64": "0.27.3", - "@esbuild/openbsd-arm64": "0.27.3", - "@esbuild/openbsd-x64": "0.27.3", - "@esbuild/openharmony-arm64": "0.27.3", - "@esbuild/sunos-x64": "0.27.3", - "@esbuild/win32-arm64": "0.27.3", - "@esbuild/win32-ia32": "0.27.3", - "@esbuild/win32-x64": "0.27.3" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/get-tsconfig": { - "version": "4.13.6", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.6.tgz", - "integrity": "sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, - "node_modules/tsx": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", - "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.27.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", - "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/yaml": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", - "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", - "license": "ISC", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - } - } -} diff --git a/pr-checks/sync_back.test.ts b/pr-checks/sync-back.test.ts similarity index 90% rename from pr-checks/sync_back.test.ts rename to pr-checks/sync-back.test.ts index 316d2b7303..8b46217492 100755 --- a/pr-checks/sync_back.test.ts +++ b/pr-checks/sync-back.test.ts @@ -1,7 +1,7 @@ #!/usr/bin/env npx tsx /* -Tests for the sync_back.ts script +Tests for the sync-back.ts script */ import * as assert from "node:assert/strict"; @@ -14,7 +14,7 @@ import { scanGeneratedWorkflows, updateSyncTs, updateTemplateFiles, -} from "./sync_back"; +} from "./sync-back"; let testDir: string; let workflowDir: string; @@ -38,8 +38,8 @@ afterEach(() => { fs.rmSync(testDir, { recursive: true, force: true }); }); -describe("scanGeneratedWorkflows", () => { - it("basic workflow scanning", () => { +describe("scanGeneratedWorkflows", async () => { + await it("basic workflow scanning", () => { /** Test basic workflow scanning functionality */ const workflowContent = ` name: Test Workflow @@ -61,7 +61,7 @@ jobs: assert.equal(result["actions/setup-go"], "v6"); }); - it("scanning workflows with version comments", () => { + await it("scanning workflows with version comments", () => { /** Test scanning workflows with version comments */ const workflowContent = ` name: Test Workflow @@ -86,7 +86,7 @@ jobs: assert.equal(result["actions/setup-python"], "v6 # Latest Python"); }); - it("ignores local actions", () => { + await it("ignores local actions", () => { /** Test that local actions (starting with ./) are ignored */ const workflowContent = ` name: Test Workflow @@ -109,8 +109,8 @@ jobs: }); }); -describe("updateSyncTs", () => { - it("updates sync.ts file", () => { +describe("updateSyncTs", async () => { + await it("updates sync.ts file", () => { /** Test updating sync.ts file */ const syncTsContent = ` const steps = [ @@ -141,7 +141,7 @@ const steps = [ assert.ok(updatedContent.includes('uses: "actions/setup-go@v6"')); }); - it("strips comments from versions", () => { + await it("strips comments from versions", () => { /** Test updating sync.ts file when versions have comments */ const syncTsContent = ` const steps = [ @@ -168,7 +168,7 @@ const steps = [ assert.ok(!updatedContent.includes("# Latest version")); }); - it("returns false when no changes are needed", () => { + await it("returns false when no changes are needed", () => { /** Test that updateSyncTs returns false when no changes are needed */ const syncTsContent = ` const steps = [ @@ -190,8 +190,8 @@ const steps = [ }); }); -describe("updateTemplateFiles", () => { - it("updates template files", () => { +describe("updateTemplateFiles", async () => { + await it("updates template files", () => { /** Test updating template files */ const templateContent = ` name: Test Template @@ -220,7 +220,7 @@ steps: assert.ok(updatedContent.includes("uses: actions/setup-node@v5 # Latest")); }); - it("preserves version comments", () => { + await it("preserves version comments", () => { /** Test that updating template files preserves version comments */ const templateContent = ` name: Test Template @@ -232,8 +232,7 @@ steps: fs.writeFileSync(templatePath, templateContent); const actionVersions = { - "ruby/setup-ruby": - "55511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0", + "ruby/setup-ruby": "55511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0", }; const result = updateTemplateFiles(checksDir, actionVersions); diff --git a/pr-checks/sync_back.ts b/pr-checks/sync-back.ts similarity index 95% rename from pr-checks/sync_back.ts rename to pr-checks/sync-back.ts index 7e1375580b..5d7275e812 100755 --- a/pr-checks/sync_back.ts +++ b/pr-checks/sync-back.ts @@ -17,9 +17,8 @@ those changes are properly synced back to the source templates. Regular workflow files are updated directly by Dependabot and don't need sync-back. */ -import { parseArgs } from "node:util"; - import * as fs from "fs"; +import { parseArgs } from "node:util"; import * as path from "path"; const THIS_DIR = __dirname; @@ -33,7 +32,9 @@ const SYNC_TS_PATH = path.join(THIS_DIR, "sync.ts"); * @param workflowDir - Path to .github/workflows directory * @returns Map from action names to their latest versions (including comments) */ -export function scanGeneratedWorkflows(workflowDir: string): Record { +export function scanGeneratedWorkflows( + workflowDir: string, +): Record { const actionVersions: Record = {}; const generatedFiles = fs @@ -96,10 +97,7 @@ export function updateSyncTs( // variable - that's a risk we're happy to take since in that case the // PR checks will just fail. const escaped = actionName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - const pattern = new RegExp( - `(uses:\\s*")${escaped}@(?:[^"]+)(")`, - "g", - ); + const pattern = new RegExp(`(uses:\\s*")${escaped}@(?:[^"]+)(")`, "g"); content = content.replace(pattern, `$1${actionName}@${version}$2`); } @@ -141,10 +139,7 @@ export function updateTemplateFiles( )) { // Look for patterns like 'uses: actions/setup-node@v4' or 'uses: actions/setup-node@sha # comment' const escaped = actionName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - const pattern = new RegExp( - `(uses:\\s+${escaped})@(?:[^@\n]+)`, - "g", - ); + const pattern = new RegExp(`(uses:\\s+${escaped})@(?:[^@\n]+)`, "g"); content = content.replace(pattern, `$1@${versionWithComment}`); } diff --git a/pr-checks/sync.ts b/pr-checks/sync.ts index ca2b069cb6..8a1842323c 100755 --- a/pr-checks/sync.ts +++ b/pr-checks/sync.ts @@ -5,6 +5,8 @@ import * as path from "path"; import * as yaml from "yaml"; +import { KnownLanguage } from "../src/languages"; + /** Known workflow input names. */ enum KnownInputName { GoVersion = "go-version", @@ -29,43 +31,69 @@ type WorkflowInputs = Partial>; /** * Represents PR check specifications. */ -interface Specification { - /** The display name for the check. */ - name: string; - /** The workflow steps specific to this check. */ - steps: any[]; +interface Specification extends JobSpecification { /** Workflow-level input definitions forwarded to `workflow_dispatch`/`workflow_call`. */ inputs?: Record; /** CodeQL bundle versions to test against. Defaults to `DEFAULT_TEST_VERSIONS`. */ versions?: string[]; /** Operating system prefixes used to select runner images (e.g. `["ubuntu", "macos"]`). */ operatingSystems?: string[]; + /** Per-OS version overrides. If specified for an OS, only those versions are tested on that OS. */ + osCodeQlVersions?: Record; /** Whether to use the all-platform CodeQL bundle. */ useAllPlatformBundle?: string; /** Values for the `analysis-kinds` matrix dimension. */ analysisKinds?: string[]; - installNode?: boolean; - installGo?: boolean; - installJava?: boolean; - installPython?: boolean; - installDotNet?: boolean; - installYq?: boolean; - /** Container image configuration for the job. */ container?: any; /** Service containers for the job. */ services?: any; + /** Additional jobs to run after the main PR check job. */ + validationJobs?: Record; + + /** If set, this check is part of a named collection that gets its own caller workflow. */ + collection?: string; +} + +/** Minimal type to represent steps in Actions workflows. */ +interface Step { + name?: string; + [other: string]: any; +} + +/** Represents job specifications. */ +interface JobSpecification { + /** The display name for the check. */ + name: string; /** Custom permissions override for the job. */ permissions?: Record; /** Extra environment variables for the job. */ env?: Record; - /** If set, this check is part of a named collection that gets its own caller workflow. */ - collection?: string; + /** The workflow steps specific to this check. */ + steps: Step[]; + + installNode?: boolean; + installGo?: boolean; + installJava?: boolean; + installPython?: boolean; + installDotNet?: boolean; + installYq?: boolean; +} + +/** Describes language/framework-specific steps and inputs. */ +interface LanguageSetup { + specProperty: keyof JobSpecification; + /** The names of the known inputs which are required for this setup step. */ + inputs?: KnownInputName[]; + steps: Step[]; } +/** Describes partial mappings from known languages to their specific setup information. */ +type LanguageSetups = Partial>; + // The default set of CodeQL Bundle versions to use for the PR checks. const defaultTestVersions = [ // The oldest supported CodeQL version. If bumping, update `CODEQL_MINIMUM_VERSION` in `codeql.ts` @@ -90,6 +118,137 @@ const defaultTestVersions = [ "nightly-latest", ]; +/** The default versions we use for languages / frameworks, if not specified as a workflow input. */ +const defaultLanguageVersions = { + javascript: "20.x", + go: ">=1.21.0", + java: "17", + python: "3.13", + csharp: "9.x", +} as const satisfies Partial>; + +/** A mapping from known input names to their specifications. */ +const inputSpecs: WorkflowInputs = { + [KnownInputName.GoVersion]: { + type: "string", + description: "The version of Go to install", + required: false, + default: defaultLanguageVersions.go, + }, + [KnownInputName.JavaVersion]: { + type: "string", + description: "The version of Java to install", + required: false, + default: defaultLanguageVersions.java, + }, + [KnownInputName.PythonVersion]: { + type: "string", + description: "The version of Python to install", + required: false, + default: defaultLanguageVersions.python, + }, + [KnownInputName.DotnetVersion]: { + type: "string", + description: "The version of .NET to install", + required: false, + default: defaultLanguageVersions.csharp, + }, +}; + +/** Obtains a `WorkflowInputs` object for all the inputs given by `requiredInputs`. */ +function getSetupInputs(requiredInputs: Set): WorkflowInputs { + const inputs: WorkflowInputs = {}; + + // Copy the input specifications for the requested inputs into the output. + for (const requiredInput of requiredInputs) { + inputs[requiredInput] = inputSpecs[requiredInput]; + } + + return inputs; +} + +/** A partial mapping from known languages to their specific setup information. */ +const languageSetups: LanguageSetups = { + javascript: { + specProperty: "installNode", + steps: [ + { + name: "Install Node.js", + uses: "actions/setup-node@v6", + with: { + "node-version": defaultLanguageVersions.javascript, + cache: "npm", + }, + }, + { + name: "Install dependencies", + run: "npm ci", + }, + ], + }, + go: { + specProperty: "installGo", + inputs: [KnownInputName.GoVersion], + steps: [ + { + name: "Install Go", + uses: "actions/setup-go@v6", + with: { + "go-version": `\${{ inputs.go-version || '${defaultLanguageVersions.go}' }}`, + // to avoid potentially misleading autobuilder results where we expect it to download + // dependencies successfully, but they actually come from a warm cache + cache: false, + }, + }, + ], + }, + java: { + specProperty: "installJava", + inputs: [KnownInputName.JavaVersion], + steps: [ + { + name: "Install Java", + uses: "actions/setup-java@v5", + with: { + "java-version": `\${{ inputs.java-version || '${defaultLanguageVersions.java}' }}`, + distribution: "temurin", + }, + }, + ], + }, + python: { + specProperty: "installPython", + inputs: [KnownInputName.PythonVersion], + steps: [ + { + name: "Install Python", + uses: "actions/setup-python@v6", + with: { + "python-version": `\${{ inputs.python-version || '${defaultLanguageVersions.python}' }}`, + }, + }, + ], + }, + csharp: { + specProperty: "installDotNet", + inputs: [KnownInputName.DotnetVersion], + steps: [ + { + name: "Install .NET", + uses: "actions/setup-dotnet@v5", + with: { + "dotnet-version": `\${{ inputs.dotnet-version || '${defaultLanguageVersions.csharp}' }}`, + }, + }, + ], + }, +}; + +// This is essentially an arbitrary version of `yq`, which happened to be the one that +// `choco` fetched when we moved away from using that here. +// See https://github.com/github/codeql-action/pull/3423 +const YQ_VERSION = "v4.50.1"; + const THIS_DIR = __dirname; const CHECKS_DIR = path.join(THIS_DIR, "checks"); const OUTPUT_DIR = path.join(THIS_DIR, "..", ".github", "workflows"); @@ -102,6 +261,11 @@ function loadYaml(filePath: string): yaml.Document { return yaml.parseDocument(content); } +/** Computes the union of all given `sets`. */ +function unionAll(sets: Array>): Set { + return sets.reduce((prev, cur) => prev.union(cur), new Set()); +} + /** * Serialize a value to YAML and write it to a file, prepended with the * standard header comment. @@ -134,112 +298,137 @@ function stripTrailingWhitespace(content: string): string { .join("\n"); } -/** - * Main entry point for the sync script. - */ -function main(): void { - // Ensure the output directory exists. - fs.mkdirSync(OUTPUT_DIR, { recursive: true }); +/** Generates the matrix for a job. */ +function generateJobMatrix( + checkSpecification: Specification, +): Array> { + let matrix: Array> = []; - // Discover and sort all check specification files. - const checkFiles = fs - .readdirSync(CHECKS_DIR) - .filter((f) => f.endsWith(".yml")) - .sort() - .map((f) => path.join(CHECKS_DIR, f)); - - console.log(`Found ${checkFiles.length} check specification(s).`); - - const collections: Record< - string, - Array<{ - specification: Specification; - checkName: string; - inputs: Record; - }> - > = {}; - - for (const file of checkFiles) { - const checkName = path.basename(file, ".yml"); - const specDocument = loadYaml(file); - const checkSpecification = specDocument.toJS() as Specification; - - console.log(`Processing: ${checkName} — "${checkSpecification.name}"`); + for (const version of checkSpecification.versions ?? defaultTestVersions) { + if (version === "latest") { + throw new Error( + `Did not recognise "version: ${version}". Did you mean "version: linked"?`, + ); + } - const workflowInputs: WorkflowInputs = {}; - let matrix: Array> = []; + const runnerImages = ["ubuntu-latest", "macos-latest", "windows-latest"]; + const operatingSystems = checkSpecification.operatingSystems ?? ["ubuntu"]; - for (const version of checkSpecification.versions ?? defaultTestVersions) { - if (version === "latest") { - throw new Error( - 'Did not recognise "version: latest". Did you mean "version: linked"?', - ); + for (const operatingSystem of operatingSystems) { + // If osCodeQlVersions is set for this OS, only include the specified CodeQL versions. + const allowedVersions = + checkSpecification.osCodeQlVersions?.[operatingSystem]; + if (allowedVersions && !allowedVersions.includes(version)) { + continue; } - const runnerImages = ["ubuntu-latest", "macos-latest", "windows-latest"]; - const operatingSystems = checkSpecification.operatingSystems ?? [ - "ubuntu", - ]; - - for (const operatingSystem of operatingSystems) { - const runnerImagesForOs = runnerImages.filter((image) => - image.startsWith(operatingSystem), - ); - - for (const runnerImage of runnerImagesForOs) { - matrix.push({ - os: runnerImage, - version, - }); - } + const runnerImagesForOs = runnerImages.filter((image) => + image.startsWith(operatingSystem), + ); + + for (const runnerImage of runnerImagesForOs) { + matrix.push({ + os: runnerImage, + version, + }); } } + } - const useAllPlatformBundle = checkSpecification.useAllPlatformBundle - ? checkSpecification.useAllPlatformBundle - : "false"; - - if (checkSpecification.analysisKinds) { - const newMatrix: Array> = []; - for (const matrixInclude of matrix) { - for (const analysisKind of checkSpecification.analysisKinds) { - newMatrix.push({ - ...matrixInclude, - "analysis-kinds": analysisKind, - }); - } + if (checkSpecification.analysisKinds) { + const newMatrix: Array> = []; + for (const matrixInclude of matrix) { + for (const analysisKind of checkSpecification.analysisKinds) { + newMatrix.push({ + ...matrixInclude, + "analysis-kinds": analysisKind, + }); } - matrix = newMatrix; } + matrix = newMatrix; + } - // Construct the workflow steps needed for this check. - const steps: any[] = [ - { - name: "Check out repository", - uses: "actions/checkout@v6", - }, - ]; - - const installNode = checkSpecification.installNode; - - if (installNode) { - steps.push( - { - name: "Install Node.js", - uses: "actions/setup-node@v6", - with: { - "node-version": "20.x", - cache: "npm", - }, - }, - { - name: "Install dependencies", - run: "npm ci", - }, - ); + return matrix; +} + +/** + * Retrieves setup steps and additional input definitions based on specific languages or frameworks + * that are requested by the `checkSpecification`. + * + * @returns An object containing setup steps and required input names. + */ +function getSetupSteps(checkSpecification: JobSpecification): { + inputs: Set; + steps: Step[]; +} { + const inputs: Array> = []; + const steps: Step[] = []; + + for (const language of Object.values(KnownLanguage).sort()) { + const setupSpec = languageSetups[language]; + + if ( + setupSpec === undefined || + checkSpecification[setupSpec.specProperty] !== true + ) { + continue; } + steps.push(...setupSpec.steps); + inputs.push(new Set(setupSpec.inputs)); + } + + const installYq = checkSpecification.installYq; + + if (installYq) { steps.push({ + name: "Install yq", + if: "runner.os == 'Windows'", + env: { + YQ_PATH: "${{ runner.temp }}/yq", + YQ_VERSION, + }, + run: + 'gh release download --repo mikefarah/yq --pattern "yq_windows_amd64.exe" "$YQ_VERSION" -O "$YQ_PATH/yq.exe"\n' + + 'echo "$YQ_PATH" >> "$GITHUB_PATH"', + }); + } + + return { inputs: unionAll(inputs), steps }; +} + +/** + * Generates an Actions job from the `checkSpecification`. + * + * @param specDocument + * The raw YAML document of the PR check specification. + * Used to extract `jobs` without losing the original formatting. + * @param checkSpecification The PR check specification. + * @returns The job and additional workflow inputs. + */ +function generateJob( + specDocument: yaml.Document, + checkSpecification: Specification, +) { + const matrix: Array> = + generateJobMatrix(checkSpecification); + + const useAllPlatformBundle = checkSpecification.useAllPlatformBundle + ? checkSpecification.useAllPlatformBundle + : "false"; + + // Determine which languages or frameworks have to be installed. + const setupInfo = getSetupSteps(checkSpecification); + const workflowInputs = setupInfo.inputs; + + // Construct the workflow steps needed for this check. + const steps: Step[] = [ + { + name: "Check out repository", + uses: "actions/checkout@v6", + }, + ...setupInfo.steps, + { name: "Prepare test", id: "prepare-test", uses: "./.github/actions/prepare-test", @@ -250,164 +439,194 @@ function main(): void { // This is because the kotlin binaries cannot be downloaded from the container. "setup-kotlin": "container" in checkSpecification ? "false" : "true", }, - }); + }, + ]; + + // Extract the sequence of steps from the YAML document to persist as much formatting as possible. + const specSteps = specDocument.get("steps") as yaml.YAMLSeq; + + // A handful of workflow specifications use double quotes for values, while we generally use single quotes. + // This replaces double quotes with single quotes for consistency. + yaml.visit(specSteps, { + Scalar(_key, node) { + if (node.type === "QUOTE_DOUBLE") { + node.type = "QUOTE_SINGLE"; + } + }, + }); - const installGo = checkSpecification.installGo; + // Add the generated steps in front of the ones from the specification. + specSteps.items.unshift(...steps); - if (installGo) { - const baseGoVersionExpr = ">=1.21.0"; - workflowInputs[KnownInputName.GoVersion] = { - type: "string", - description: "The version of Go to install", - required: false, - default: baseGoVersionExpr, - }; + const checkJob: Record = { + strategy: { + "fail-fast": false, + matrix: { + include: matrix, + }, + }, + name: checkSpecification.name, + if: "github.triggering_actor != 'dependabot[bot]'", + permissions: { + contents: "read", + "security-events": "read", + }, + "timeout-minutes": 45, + "runs-on": "${{ matrix.os }}", + steps: specSteps, + }; + + if (checkSpecification.permissions) { + checkJob.permissions = checkSpecification.permissions; + } - steps.push({ - name: "Install Go", - uses: "actions/setup-go@v6", - with: { - "go-version": - "${{ inputs.go-version || '" + baseGoVersionExpr + "' }}", - // to avoid potentially misleading autobuilder results where we expect it to download - // dependencies successfully, but they actually come from a warm cache - cache: false, - }, - }); + for (const key of ["env", "container", "services"] as const) { + if (checkSpecification[key] !== undefined) { + checkJob[key] = checkSpecification[key]; } + } - const installJava = checkSpecification.installJava; + checkJob.env = checkJob.env ?? {}; + if (!("CODEQL_ACTION_TEST_MODE" in checkJob.env)) { + checkJob.env.CODEQL_ACTION_TEST_MODE = true; + } - if (installJava) { - const baseJavaVersionExpr = "17"; - workflowInputs[KnownInputName.JavaVersion] = { - type: "string", - description: "The version of Java to install", - required: false, - default: baseJavaVersionExpr, - }; + return { checkJob, workflowInputs }; +} - steps.push({ - name: "Install Java", - uses: "actions/setup-java@v5", - with: { - "java-version": - "${{ inputs.java-version || '" + baseJavaVersionExpr + "' }}", - distribution: "temurin", - }, - }); - } +/** Generates a validation job. */ +function generateValidationJob( + specDocument: yaml.Document, + jobSpecification: JobSpecification, + checkName: string, + name: string, +) { + // Determine which languages or frameworks have to be installed. + const { inputs, steps } = getSetupSteps(jobSpecification); + + // Extract the sequence of steps from the YAML document to persist as much formatting as possible. + const specSteps = specDocument.getIn([ + "validationJobs", + name, + "steps", + ]) as yaml.YAMLSeq; + + // Add the generated steps in front of the ones from the specification. + specSteps.items.unshift(...steps); + + const validationJob: Record = { + name: jobSpecification.name, + if: "github.triggering_actor != 'dependabot[bot]'", + needs: [checkName], + permissions: { + contents: "read", + "security-events": "read", + }, + "timeout-minutes": 5, + "runs-on": "ubuntu-slim", + steps: specSteps, + }; + + if (jobSpecification.permissions) { + validationJob.permissions = jobSpecification.permissions; + } - const installPython = checkSpecification.installPython; + for (const key of ["env"] as const) { + if (jobSpecification[key] !== undefined) { + validationJob[key] = jobSpecification[key]; + } + } - if (installPython) { - const basePythonVersionExpr = "3.13"; - workflowInputs[KnownInputName.PythonVersion] = { - type: "string", - description: "The version of Python to install", - required: false, - default: basePythonVersionExpr, - }; + validationJob.env = validationJob.env ?? {}; + if (!("CODEQL_ACTION_TEST_MODE" in validationJob.env)) { + validationJob.env.CODEQL_ACTION_TEST_MODE = true; + } - steps.push({ - name: "Install Python", - if: "matrix.version != 'nightly-latest'", - uses: "actions/setup-python@v6", - with: { - "python-version": - "${{ inputs.python-version || '" + basePythonVersionExpr + "' }}", - }, - }); - } + return { validationJob, inputs }; +} - const installDotNet = checkSpecification.installDotNet; +/** Generates additional jobs that run after the main check job, based on the `validationJobs` property. */ +function generateValidationJobs( + specDocument: yaml.Document, + checkSpecification: Specification, + checkName: string, +): { + validationJobs: Record; + workflowInputs: Set; +} { + if (checkSpecification.validationJobs === undefined) { + return { validationJobs: {}, workflowInputs: new Set() }; + } - if (installDotNet) { - const baseDotNetVersionExpr = "9.x"; - workflowInputs[KnownInputName.DotnetVersion] = { - type: "string", - description: "The version of .NET to install", - required: false, - default: baseDotNetVersionExpr, - }; + const validationJobs: Record = {}; + const workflowInputs: Array> = []; - steps.push({ - name: "Install .NET", - uses: "actions/setup-dotnet@v5", - with: { - "dotnet-version": - "${{ inputs.dotnet-version || '" + baseDotNetVersionExpr + "' }}", - }, - }); + for (const [jobName, jobSpec] of Object.entries( + checkSpecification.validationJobs, + )) { + if (checkName === jobName) { + throw new Error( + `Validation job '${jobName}' cannot have the same name as the main job.`, + ); } - const installYq = checkSpecification.installYq; - - if (installYq) { - steps.push({ - name: "Install yq", - if: "runner.os == 'Windows'", - env: { - YQ_PATH: "${{ runner.temp }}/yq", - // This is essentially an arbitrary version of `yq`, which happened to be the one that - // `choco` fetched when we moved away from using that here. - // See https://github.com/github/codeql-action/pull/3423 - YQ_VERSION: "v4.50.1", - }, - run: - 'gh release download --repo mikefarah/yq --pattern "yq_windows_amd64.exe" "$YQ_VERSION" -O "$YQ_PATH/yq.exe"\n' + - 'echo "$YQ_PATH" >> "$GITHUB_PATH"', - }); - } + const { validationJob, inputs } = generateValidationJob( + specDocument, + jobSpec, + checkName, + jobName, + ); + validationJobs[jobName] = validationJob; + workflowInputs.push(inputs); + } - // Extract the sequence of steps from the YAML document to persist as much formatting as possible. - const specSteps = specDocument.get("steps") as yaml.YAMLSeq; + return { + validationJobs, + workflowInputs: unionAll(workflowInputs), + }; +} - // A handful of workflow specifications use double quotes for values, while we generally use single quotes. - // This replaces double quotes with single quotes for consistency. - yaml.visit(specSteps, { - Scalar(_key, node) { - if (node.type === "QUOTE_DOUBLE") { - node.type = "QUOTE_SINGLE"; - } - }, - }); +/** + * Main entry point for the sync script. + */ +function main(): void { + // Ensure the output directory exists. + fs.mkdirSync(OUTPUT_DIR, { recursive: true }); - // Add the generated steps in front of the ones from the specification. - specSteps.items.unshift(...steps); + // Discover and sort all check specification files. + const checkFiles = fs + .readdirSync(CHECKS_DIR) + .filter((f) => f.endsWith(".yml")) + .sort() + .map((f) => path.join(CHECKS_DIR, f)); - const checkJob: Record = { - strategy: { - "fail-fast": false, - matrix: { - include: matrix, - }, - }, - name: checkSpecification.name, - if: "github.triggering_actor != 'dependabot[bot]'", - permissions: { - contents: "read", - "security-events": "read", - }, - "timeout-minutes": 45, - "runs-on": "${{ matrix.os }}", - steps: specSteps, - }; + console.log(`Found ${checkFiles.length} check specification(s).`); - if (checkSpecification.permissions) { - checkJob.permissions = checkSpecification.permissions; - } + const collections: Record< + string, + Array<{ + specification: Specification; + checkName: string; + inputs: Record; + }> + > = {}; - for (const key of ["env", "container", "services"] as const) { - if (checkSpecification[key] !== undefined) { - checkJob[key] = checkSpecification[key]; - } - } + for (const file of checkFiles) { + const checkName = path.basename(file, ".yml"); + const specDocument = loadYaml(file); + const checkSpecification = specDocument.toJS() as Specification; - checkJob.env = checkJob.env ?? {}; - if (!("CODEQL_ACTION_TEST_MODE" in checkJob.env)) { - checkJob.env.CODEQL_ACTION_TEST_MODE = true; - } + console.log(`Processing: ${checkName} — "${checkSpecification.name}"`); + + const { checkJob, workflowInputs } = generateJob( + specDocument, + checkSpecification, + ); + const { validationJobs, workflowInputs: validationJobInputs } = + generateValidationJobs(specDocument, checkSpecification, checkName); + const combinedInputs = getSetupInputs( + workflowInputs.union(validationJobInputs), + ); // If this check belongs to a named collection, record it. if (checkSpecification.collection) { @@ -418,13 +637,13 @@ function main(): void { collections[collectionName].push({ specification: checkSpecification, checkName, - inputs: workflowInputs, + inputs: combinedInputs, }); } let extraGroupName = ""; - for (const inputName of Object.keys(workflowInputs)) { - extraGroupName += "-${{inputs." + inputName + "}}"; + for (const inputName of Object.keys(combinedInputs)) { + extraGroupName += `-\${{inputs.${inputName}}}`; } const cron = new yaml.Scalar("0 5 * * *"); @@ -448,10 +667,10 @@ function main(): void { }, schedule: [{ cron }], workflow_dispatch: { - inputs: workflowInputs, + inputs: combinedInputs, }, workflow_call: { - inputs: workflowInputs, + inputs: combinedInputs, }, }, defaults: { @@ -462,10 +681,11 @@ function main(): void { concurrency: { "cancel-in-progress": "${{ github.event_name == 'pull_request' || false }}", - group: checkName + "-${{github.ref}}" + extraGroupName, + group: `${checkName}-\${{github.ref}}${extraGroupName}`, }, jobs: { [checkName]: checkJob, + ...validationJobs, }, }; @@ -485,7 +705,7 @@ function main(): void { combinedInputs = { ...combinedInputs, ...checkInputs }; for (const inputName of Object.keys(checkInputs)) { - checkWith[inputName] = "${{ inputs." + inputName + " }}"; + checkWith[inputName] = `\${{ inputs.${inputName} }}`; } jobs[checkName] = { diff --git a/pr-checks/tsconfig.json b/pr-checks/tsconfig.json new file mode 100644 index 0000000000..aa728005cf --- /dev/null +++ b/pr-checks/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + /* Basic Options */ + "lib": ["esnext"], + "rootDir": "..", + "sourceMap": false, + "noEmit": true, + }, + "include": ["./*.ts", "../src/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/src/actions-util.ts b/src/actions-util.ts index 736d35d0f1..e1a7adb8f0 100644 --- a/src/actions-util.ts +++ b/src/actions-util.ts @@ -5,7 +5,6 @@ import * as core from "@actions/core"; import * as toolrunner from "@actions/exec/lib/toolrunner"; import * as github from "@actions/github"; import * as io from "@actions/io"; -import { JSONSchemaForNPMPackageJsonFiles } from "@schemastore/package"; import type { Config } from "./config-utils"; import { Logger } from "./logging"; @@ -16,8 +15,11 @@ import { ConfigurationError, } from "./util"; -// eslint-disable-next-line import/no-commonjs, @typescript-eslint/no-require-imports -const pkg = require("../package.json") as JSONSchemaForNPMPackageJsonFiles; +/** + * This constant is set to the value of the `"version"` property in `package.json` by `esbuild`. + * It is also set in `ava.setup.mjs` for tests. + */ +declare const __CODEQL_ACTION_VERSION__: string; /** * Wrapper around core.getInput for inputs that always have a value. @@ -52,7 +54,7 @@ export function getTemporaryDirectory(): string { } export function getActionVersion(): string { - return pkg.version!; + return __CODEQL_ACTION_VERSION__; } /** diff --git a/src/api-client.test.ts b/src/api-client.test.ts index d0311d0dc5..f8846e7682 100644 --- a/src/api-client.test.ts +++ b/src/api-client.test.ts @@ -5,6 +5,7 @@ import * as sinon from "sinon"; import * as actionsUtil from "./actions-util"; import * as api from "./api-client"; +import { DO_NOT_RETRY_STATUSES } from "./api-client"; import { setupTests } from "./testing-utils"; import * as util from "./util"; @@ -37,7 +38,7 @@ test.serial("getApiClient", async (t) => { log: sinon.match.any, userAgent: `CodeQL-Action/${actionsUtil.getActionVersion()}`, retry: { - doNotRetry: [400, 410, 422, 451], + doNotRetry: DO_NOT_RETRY_STATUSES, }, }), ); diff --git a/src/api-client.ts b/src/api-client.ts index 13babcd385..4b8cb7b340 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -19,6 +19,15 @@ import { const GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; +/** + * HTTP status codes that should not be retried. + * + * The default Octokit list is 400, 401, 403, 404, 410, 422, and 451. We have + * observed transient errors with authentication, so we remove 401, 403, and 404 + * from the default list to ensure that these errors are retried. + */ +export const DO_NOT_RETRY_STATUSES = [400, 410, 422, 451]; + export type GitHubApiCombinedDetails = GitHubApiDetails & GitHubApiExternalRepoDetails; @@ -52,10 +61,7 @@ function createApiClientWithDetails( error: core.error, }, retry: { - // The default is 400, 401, 403, 404, 410, 422, and 451. We have observed transient errors - // with authentication, so we remove 401, 403, and 404 from the default list to ensure that - // these errors are retried. - doNotRetry: [400, 410, 422, 451], + doNotRetry: DO_NOT_RETRY_STATUSES, }, }), ); diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index 06994c0ede..1887f12734 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -2011,6 +2011,23 @@ for (const language in KnownLanguage) { ); } +// Verify that a language without a per-language overlay feature flag cannot have +// overlay analysis enabled, even when the base overlay feature flag is on. +// Using cpp here as it doesn't currently have overlay support — update this if +// cpp gains overlay support. +test.serial( + checkOverlayEnablementMacro, + "No overlay analysis for language without per-language overlay feature flag", + { + languages: [KnownLanguage.cpp], + features: [Feature.OverlayAnalysis], + isPullRequest: true, + }, + { + disabledReason: OverlayDisabledReason.LanguageNotEnabled, + }, +); + test.serial( "hasActionsWorkflows doesn't throw if workflows folder doesn't exist", async (t) => { diff --git a/src/config-utils.ts b/src/config-utils.ts index b805869388..67b3ae23d4 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -630,30 +630,29 @@ async function loadUserConfig( } } -const OVERLAY_ANALYSIS_FEATURES: Record = { - actions: Feature.OverlayAnalysisActions, - cpp: Feature.OverlayAnalysisCpp, +/** + * Maps languages to their overlay analysis feature flags. Only languages that + * are GA or in staff-ship for overlay analysis are included here. Languages + * without an entry will have overlay analysis disabled. + */ +const OVERLAY_ANALYSIS_FEATURES: Partial> = { csharp: Feature.OverlayAnalysisCsharp, go: Feature.OverlayAnalysisGo, java: Feature.OverlayAnalysisJava, javascript: Feature.OverlayAnalysisJavascript, python: Feature.OverlayAnalysisPython, ruby: Feature.OverlayAnalysisRuby, - rust: Feature.OverlayAnalysisRust, - swift: Feature.OverlayAnalysisSwift, }; -const OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES: Record = { - actions: Feature.OverlayAnalysisCodeScanningActions, - cpp: Feature.OverlayAnalysisCodeScanningCpp, +const OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES: Partial< + Record +> = { csharp: Feature.OverlayAnalysisCodeScanningCsharp, go: Feature.OverlayAnalysisCodeScanningGo, java: Feature.OverlayAnalysisCodeScanningJava, javascript: Feature.OverlayAnalysisCodeScanningJavascript, python: Feature.OverlayAnalysisCodeScanningPython, ruby: Feature.OverlayAnalysisCodeScanningRuby, - rust: Feature.OverlayAnalysisCodeScanningRust, - swift: Feature.OverlayAnalysisCodeScanningSwift, }; /** @@ -1555,6 +1554,13 @@ export function isCodeQualityEnabled(config: Config): boolean { return config.analysisKinds.includes(AnalysisKind.CodeQuality); } +/** + * Returns `true` if Code Scanning Risk Assessment analysis is enabled, or `false` if not. + */ +export function isRiskAssessmentEnabled(config: Config): boolean { + return config.analysisKinds.includes(AnalysisKind.RiskAssessment); +} + /** * Returns the primary analysis kind that the Action is initialised with. If there is only * one analysis kind, then that is returned. diff --git a/src/database-upload.test.ts b/src/database-upload.test.ts index 3d8433d8b5..c4ac59e76b 100644 --- a/src/database-upload.test.ts +++ b/src/database-upload.test.ts @@ -15,6 +15,7 @@ import * as gitUtils from "./git-utils"; import { KnownLanguage } from "./languages"; import { RepositoryNwo } from "./repository"; import { + checkExpectedLogMessages, createFeatures, createTestConfig, getRecordingLogger, @@ -93,7 +94,7 @@ test.serial( .returns("false"); sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true); - const loggedMessages = []; + const loggedMessages: LoggedMessage[] = []; await cleanupAndUploadDatabases( testRepoName, getCodeQL(), @@ -102,14 +103,9 @@ test.serial( createFeatures([]), getRecordingLogger(loggedMessages), ); - t.assert( - loggedMessages.find( - (v: LoggedMessage) => - v.type === "debug" && - v.message === - "Database upload disabled in workflow. Skipping upload.", - ) !== undefined, - ); + checkExpectedLogMessages(t, loggedMessages, [ + "Database upload disabled in workflow. Skipping upload.", + ]); }); }, ); @@ -127,7 +123,7 @@ test.serial( await mockHttpRequests(201); - const loggedMessages = []; + const loggedMessages: LoggedMessage[] = []; await cleanupAndUploadDatabases( testRepoName, getCodeQL(), @@ -139,14 +135,9 @@ test.serial( createFeatures([]), getRecordingLogger(loggedMessages), ); - t.assert( - loggedMessages.find( - (v: LoggedMessage) => - v.type === "debug" && - v.message === - "Not uploading database because 'analysis-kinds: code-scanning' is not enabled.", - ) !== undefined, - ); + checkExpectedLogMessages(t, loggedMessages, [ + "Not uploading database because 'analysis-kinds: code-scanning' is not enabled.", + ]); }); }, ); @@ -163,7 +154,7 @@ test.serial("Abort database upload if running against GHES", async (t) => { const config = getTestConfig(tmpDir); config.gitHubVersion = { type: GitHubVariant.GHES, version: "3.0" }; - const loggedMessages = []; + const loggedMessages: LoggedMessage[] = []; await cleanupAndUploadDatabases( testRepoName, getCodeQL(), @@ -172,14 +163,9 @@ test.serial("Abort database upload if running against GHES", async (t) => { createFeatures([]), getRecordingLogger(loggedMessages), ); - t.assert( - loggedMessages.find( - (v: LoggedMessage) => - v.type === "debug" && - v.message === - "Not running against github.com or GHEC-DR. Skipping upload.", - ) !== undefined, - ); + checkExpectedLogMessages(t, loggedMessages, [ + "Not running against github.com or GHEC-DR. Skipping upload.", + ]); }); }); @@ -194,7 +180,7 @@ test.serial( .returns("true"); sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(false); - const loggedMessages = []; + const loggedMessages: LoggedMessage[] = []; await cleanupAndUploadDatabases( testRepoName, getCodeQL(), @@ -203,48 +189,90 @@ test.serial( createFeatures([]), getRecordingLogger(loggedMessages), ); - t.assert( - loggedMessages.find( - (v: LoggedMessage) => - v.type === "debug" && - v.message === "Not analyzing default branch. Skipping upload.", - ) !== undefined, + checkExpectedLogMessages(t, loggedMessages, [ + "Not analyzing default branch. Skipping upload.", + ]); + }); + }, +); + +test.serial( + "Don't crash if uploading a database fails with a non-retryable error", + async (t) => { + await withTmpDir(async (tmpDir) => { + setupActionsVars(tmpDir, tmpDir); + sinon + .stub(actionsUtil, "getRequiredInput") + .withArgs("upload-database") + .returns("true"); + sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true); + + const databaseUploadSpy = await mockHttpRequests(422); + + const loggedMessages: LoggedMessage[] = []; + await cleanupAndUploadDatabases( + testRepoName, + getCodeQL(), + getTestConfig(tmpDir), + testApiDetails, + createFeatures([]), + getRecordingLogger(loggedMessages), ); + + checkExpectedLogMessages(t, loggedMessages, [ + "Failed to upload database for javascript: some error message", + ]); + + // Non-retryable errors should not be retried. + t.is(databaseUploadSpy.callCount, 1); }); }, ); -test.serial("Don't crash if uploading a database fails", async (t) => { - await withTmpDir(async (tmpDir) => { - setupActionsVars(tmpDir, tmpDir); - sinon - .stub(actionsUtil, "getRequiredInput") - .withArgs("upload-database") - .returns("true"); - sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true); +test.serial( + "Don't crash if uploading a database fails with a retryable error", + async (t) => { + await withTmpDir(async (tmpDir) => { + setupActionsVars(tmpDir, tmpDir); + sinon + .stub(actionsUtil, "getRequiredInput") + .withArgs("upload-database") + .returns("true"); + sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true); - await mockHttpRequests(500); + const databaseUploadSpy = await mockHttpRequests(500); - const loggedMessages = [] as LoggedMessage[]; - await cleanupAndUploadDatabases( - testRepoName, - getCodeQL(), - getTestConfig(tmpDir), - testApiDetails, - createFeatures([]), - getRecordingLogger(loggedMessages), - ); + // Stub setTimeout to fire immediately to avoid real delays from retry backoff. + const originalSetTimeout = global.setTimeout; + const setTimeoutStub = sinon + .stub(global, "setTimeout") + .callsFake((fn: () => void) => originalSetTimeout(fn, 0)); - t.assert( - loggedMessages.find( - (v) => - v.type === "warning" && - v.message === - "Failed to upload database for javascript: some error message", - ) !== undefined, - ); - }); -}); + const loggedMessages: LoggedMessage[] = []; + await cleanupAndUploadDatabases( + testRepoName, + getCodeQL(), + getTestConfig(tmpDir), + testApiDetails, + createFeatures([]), + getRecordingLogger(loggedMessages), + ); + + checkExpectedLogMessages(t, loggedMessages, [ + "Failed to upload database for javascript: some error message", + ]); + + // Retryable errors should be retried the expected number of times. + t.is(databaseUploadSpy.callCount, 4); + + // setTimeout should have been called with the expected backoff delays. + const setTimeoutDelays = setTimeoutStub.args.map( + (args) => args[1] as number, + ); + t.deepEqual(setTimeoutDelays, [15_000, 30_000, 60_000]); + }); + }, +); test.serial("Successfully uploading a database to github.com", async (t) => { await withTmpDir(async (tmpDir) => { @@ -257,7 +285,7 @@ test.serial("Successfully uploading a database to github.com", async (t) => { await mockHttpRequests(201); - const loggedMessages = [] as LoggedMessage[]; + const loggedMessages: LoggedMessage[] = []; await cleanupAndUploadDatabases( testRepoName, getCodeQL(), @@ -266,13 +294,9 @@ test.serial("Successfully uploading a database to github.com", async (t) => { createFeatures([]), getRecordingLogger(loggedMessages), ); - t.assert( - loggedMessages.find( - (v) => - v.type === "debug" && - v.message === "Successfully uploaded database for javascript", - ) !== undefined, - ); + checkExpectedLogMessages(t, loggedMessages, [ + "Successfully uploaded database for javascript", + ]); }); }); @@ -287,7 +311,7 @@ test.serial("Successfully uploading a database to GHEC-DR", async (t) => { const databaseUploadSpy = await mockHttpRequests(201); - const loggedMessages = [] as LoggedMessage[]; + const loggedMessages: LoggedMessage[] = []; await cleanupAndUploadDatabases( testRepoName, getCodeQL(), @@ -300,13 +324,9 @@ test.serial("Successfully uploading a database to GHEC-DR", async (t) => { createFeatures([]), getRecordingLogger(loggedMessages), ); - t.assert( - loggedMessages.find( - (v) => - v.type === "debug" && - v.message === "Successfully uploaded database for javascript", - ) !== undefined, - ); + checkExpectedLogMessages(t, loggedMessages, [ + "Successfully uploaded database for javascript", + ]); t.assert( databaseUploadSpy.calledOnceWith( sinon.match.string, diff --git a/src/database-upload.ts b/src/database-upload.ts index 41546697f6..c7db68fc3d 100644 --- a/src/database-upload.ts +++ b/src/database-upload.ts @@ -2,7 +2,11 @@ import * as fs from "fs"; import * as actionsUtil from "./actions-util"; import { AnalysisKind } from "./analyses"; -import { getApiClient, GitHubApiDetails } from "./api-client"; +import { + DO_NOT_RETRY_STATUSES, + getApiClient, + GitHubApiDetails, +} from "./api-client"; import { type CodeQL } from "./codeql"; import { Config } from "./config-utils"; import { Feature, FeatureEnablement } from "./feature-flags"; @@ -11,7 +15,7 @@ import { Logger, withGroupAsync } from "./logging"; import { OverlayDatabaseMode } from "./overlay"; import { RepositoryNwo } from "./repository"; import * as util from "./util"; -import { bundleDb, CleanupLevel, parseGitHubUrl } from "./util"; +import { asHTTPError, bundleDb, CleanupLevel, parseGitHubUrl } from "./util"; /** Information about a database upload. */ export interface DatabaseUploadResult { @@ -81,18 +85,6 @@ export async function cleanupAndUploadDatabases( await codeql.databaseCleanupCluster(config, cleanupLevel); }); - const client = getApiClient(); - - const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url)); - uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`; - - // Octokit expects the baseUrl to not have a trailing slash, - // but it is included by default in a URL. - let uploadsBaseUrl = uploadsUrl.toString(); - if (uploadsBaseUrl.endsWith("/")) { - uploadsBaseUrl = uploadsBaseUrl.slice(0, -1); - } - const reports: DatabaseUploadResult[] = []; for (const language of config.languages) { let bundledDbSize: number | undefined = undefined; @@ -105,40 +97,51 @@ export async function cleanupAndUploadDatabases( includeDiagnostics: false, }); bundledDbSize = fs.statSync(bundledDb).size; - const bundledDbReadStream = fs.createReadStream(bundledDb); const commitOid = await gitUtils.getCommitOid( actionsUtil.getRequiredInput("checkout_path"), ); - try { - const startTime = performance.now(); - await client.request( - `POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, - { - baseUrl: uploadsBaseUrl, - owner: repositoryNwo.owner, - repo: repositoryNwo.repo, + // Upload with manual retry logic. We disable Octokit's built-in retries + // because the request body is a ReadStream, which can only be consumed + // once. + const maxAttempts = 4; // 1 initial attempt + 3 retries, identical to the default retry behavior of Octokit + let uploadDurationMs: number | undefined; + for (let attempt = 1; attempt <= maxAttempts; attempt++) { + try { + uploadDurationMs = await uploadBundledDatabase( + repositoryNwo, language, - name: `${language}-database`, - commit_oid: commitOid, - data: bundledDbReadStream, - headers: { - authorization: `token ${apiDetails.auth}`, - "Content-Type": "application/zip", - "Content-Length": bundledDbSize, - }, - }, - ); - const endTime = performance.now(); - reports.push({ - language, - zipped_upload_size_bytes: bundledDbSize, - is_overlay_base: shouldUploadOverlayBase, - upload_duration_ms: endTime - startTime, - }); - logger.debug(`Successfully uploaded database for ${language}`); - } finally { - bundledDbReadStream.close(); + commitOid, + bundledDb, + bundledDbSize, + apiDetails, + ); + break; + } catch (e) { + const httpError = asHTTPError(e); + const isRetryable = + !httpError || !DO_NOT_RETRY_STATUSES.includes(httpError.status); + if (!isRetryable) { + throw e; + } else if (attempt === maxAttempts) { + logger.error( + `Maximum retry attempts exhausted (${attempt}), aborting database upload`, + ); + throw e; + } + const backoffMs = 15_000 * Math.pow(2, attempt - 1); // 15s, 30s, 60s + logger.debug( + `Database upload attempt ${attempt} of ${maxAttempts} failed for ${language}: ${util.getErrorMessage(e)}. Retrying in ${backoffMs / 1000}s...`, + ); + await new Promise((resolve) => setTimeout(resolve, backoffMs)); + } } + reports.push({ + language, + zipped_upload_size_bytes: bundledDbSize, + is_overlay_base: shouldUploadOverlayBase, + upload_duration_ms: uploadDurationMs, + }); + logger.debug(`Successfully uploaded database for ${language}`); } catch (e) { // Log a warning but don't fail the workflow logger.warning( @@ -155,3 +158,58 @@ export async function cleanupAndUploadDatabases( } return reports; } + +/** + * Uploads a bundled database to the GitHub API. + * + * @returns the duration of the upload in milliseconds + */ +async function uploadBundledDatabase( + repositoryNwo: RepositoryNwo, + language: string, + commitOid: string, + bundledDb: string, + bundledDbSize: number, + apiDetails: GitHubApiDetails, +): Promise { + const client = getApiClient(); + + const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url)); + uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`; + + // Octokit expects the baseUrl to not have a trailing slash, + // but it is included by default in a URL. + let uploadsBaseUrl = uploadsUrl.toString(); + if (uploadsBaseUrl.endsWith("/")) { + uploadsBaseUrl = uploadsBaseUrl.slice(0, -1); + } + + const bundledDbReadStream = fs.createReadStream(bundledDb); + try { + const startTime = performance.now(); + await client.request( + `POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, + { + baseUrl: uploadsBaseUrl, + owner: repositoryNwo.owner, + repo: repositoryNwo.repo, + language, + name: `${language}-database`, + commit_oid: commitOid, + data: bundledDbReadStream, + headers: { + authorization: `token ${apiDetails.auth}`, + "Content-Type": "application/zip", + "Content-Length": bundledDbSize, + }, + // Disable `octokit/plugin-retry.js`, since the request body is a ReadStream which can only be consumed once. + request: { + retries: 0, + }, + }, + ); + return performance.now() - startTime; + } finally { + bundledDbReadStream.close(); + } +} diff --git a/src/debug-artifacts.ts b/src/debug-artifacts.ts index aea5af01fb..ec6940500d 100644 --- a/src/debug-artifacts.ts +++ b/src/debug-artifacts.ts @@ -12,6 +12,7 @@ import { scanArtifactsForTokens } from "./artifact-scanner"; import { type CodeQL } from "./codeql"; import { Config } from "./config-utils"; import { EnvVar } from "./environment"; +import * as json from "./json"; import { Language } from "./languages"; import { Logger, withGroup } from "./logging"; import { @@ -261,7 +262,7 @@ export function getArtifactSuffix(matrix: string | undefined): string { if (matrix) { try { const matrixObject = JSON.parse(matrix); - if (matrixObject !== null && typeof matrixObject === "object") { + if (json.isObject(matrixObject)) { for (const matrixKey of Object.keys(matrixObject as object).sort()) suffix += `-${matrixObject[matrixKey]}`; } else { diff --git a/src/environment.ts b/src/environment.ts index 75fc3a7de6..ed44ddcff2 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -47,6 +47,15 @@ export enum EnvVar { /** Whether the init action has been run. */ INIT_ACTION_HAS_RUN = "CODEQL_ACTION_INIT_HAS_RUN", + /** Whether the deprecation warning for file coverage on PRs has been logged. */ + DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION = "CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION", + + /** + * Set to `true` to opt out of the upcoming change that skips file coverage + * information on pull requests. + */ + FILE_COVERAGE_ON_PRS = "CODEQL_ACTION_FILE_COVERAGE_ON_PRS", + /** Whether the error for a deprecated version of the CodeQL Action was logged. */ LOG_VERSION_DEPRECATION = "CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION", diff --git a/src/feature-flags.ts b/src/feature-flags.ts index c77bd794f1..e45d7f93c9 100644 --- a/src/feature-flags.ts +++ b/src/feature-flags.ts @@ -7,7 +7,15 @@ import { getApiClient } from "./api-client"; import type { CodeQL } from "./codeql"; import * as defaults from "./defaults.json"; import { Logger } from "./logging"; -import { CODEQL_OVERLAY_MINIMUM_VERSION } from "./overlay"; +import { + CODEQL_OVERLAY_MINIMUM_VERSION, + CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP, + CODEQL_OVERLAY_MINIMUM_VERSION_GO, + CODEQL_OVERLAY_MINIMUM_VERSION_JAVA, + CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT, + CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON, + CODEQL_OVERLAY_MINIMUM_VERSION_RUBY, +} from "./overlay"; import { RepositoryNwo } from "./repository"; import { ToolsFeature } from "./tools-features"; import * as util from "./util"; @@ -49,24 +57,18 @@ export enum Feature { IgnoreGeneratedFiles = "ignore_generated_files", JavaNetworkDebugging = "java_network_debugging", OverlayAnalysis = "overlay_analysis", - OverlayAnalysisActions = "overlay_analysis_actions", - OverlayAnalysisCodeScanningActions = "overlay_analysis_code_scanning_actions", - OverlayAnalysisCodeScanningCpp = "overlay_analysis_code_scanning_cpp", OverlayAnalysisCodeScanningCsharp = "overlay_analysis_code_scanning_csharp", OverlayAnalysisCodeScanningGo = "overlay_analysis_code_scanning_go", OverlayAnalysisCodeScanningJava = "overlay_analysis_code_scanning_java", OverlayAnalysisCodeScanningJavascript = "overlay_analysis_code_scanning_javascript", OverlayAnalysisCodeScanningPython = "overlay_analysis_code_scanning_python", OverlayAnalysisCodeScanningRuby = "overlay_analysis_code_scanning_ruby", - OverlayAnalysisCodeScanningRust = "overlay_analysis_code_scanning_rust", - OverlayAnalysisCodeScanningSwift = "overlay_analysis_code_scanning_swift", - OverlayAnalysisCpp = "overlay_analysis_cpp", OverlayAnalysisCsharp = "overlay_analysis_csharp", + OverlayAnalysisGo = "overlay_analysis_go", /** Controls whether the Actions cache is checked for overlay build outcomes. */ OverlayAnalysisStatusCheck = "overlay_analysis_status_check", /** Controls whether overlay build failures on are stored in the Actions cache. */ OverlayAnalysisStatusSave = "overlay_analysis_status_save", - OverlayAnalysisGo = "overlay_analysis_go", OverlayAnalysisJava = "overlay_analysis_java", OverlayAnalysisJavascript = "overlay_analysis_javascript", OverlayAnalysisPython = "overlay_analysis_python", @@ -76,10 +78,8 @@ export enum Feature { */ OverlayAnalysisResourceChecksV2 = "overlay_analysis_resource_checks_v2", OverlayAnalysisRuby = "overlay_analysis_ruby", - OverlayAnalysisRust = "overlay_analysis_rust", /** Controls whether hardware checks are skipped for overlay analysis. */ OverlayAnalysisSkipResourceChecks = "overlay_analysis_skip_resource_checks", - OverlayAnalysisSwift = "overlay_analysis_swift", PythonDefaultIsToNotExtractStdlib = "python_default_is_to_not_extract_stdlib", QaTelemetryEnabled = "qa_telemetry_enabled", /** Note that this currently only disables baseline file coverage information. */ @@ -87,7 +87,6 @@ export enum Feature { StartProxyRemoveUnusedRegistries = "start_proxy_remove_unused_registries", StartProxyUseFeaturesRelease = "start_proxy_use_features_release", UploadOverlayDbToApi = "upload_overlay_db_to_api", - UseRepositoryProperties = "use_repository_properties_v2", ValidateDbConfig = "validate_db_config", } @@ -195,70 +194,48 @@ export const featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION, }, - [Feature.OverlayAnalysisActions]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_ACTIONS", - minimumVersion: undefined, - }, - [Feature.OverlayAnalysisCodeScanningActions]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_ACTIONS", - minimumVersion: undefined, - }, - [Feature.OverlayAnalysisCodeScanningCpp]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CPP", - minimumVersion: undefined, - }, + // Per-language overlay feature flags. Each has minimumVersion set to the + // minimum CLI version that supports overlay analysis for that language. + // Only languages that are GA or in staff-ship should have feature flags here. [Feature.OverlayAnalysisCodeScanningCsharp]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_CSHARP", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP, }, [Feature.OverlayAnalysisCodeScanningGo]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_GO", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO, }, [Feature.OverlayAnalysisCodeScanningJava]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVA", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA, }, [Feature.OverlayAnalysisCodeScanningJavascript]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT, }, [Feature.OverlayAnalysisCodeScanningPython]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_PYTHON", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON, }, [Feature.OverlayAnalysisCodeScanningRuby]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUBY", - minimumVersion: undefined, - }, - [Feature.OverlayAnalysisCodeScanningRust]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_RUST", - minimumVersion: undefined, - }, - [Feature.OverlayAnalysisCodeScanningSwift]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_SWIFT", - minimumVersion: undefined, - }, - [Feature.OverlayAnalysisCpp]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CPP", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY, }, [Feature.OverlayAnalysisCsharp]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_CSHARP", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP, + }, + [Feature.OverlayAnalysisGo]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_GO, }, [Feature.OverlayAnalysisStatusCheck]: { defaultValue: false, @@ -270,25 +247,20 @@ export const featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_SAVE", minimumVersion: undefined, }, - [Feature.OverlayAnalysisGo]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_GO", - minimumVersion: undefined, - }, [Feature.OverlayAnalysisJava]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVA", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVA, }, [Feature.OverlayAnalysisJavascript]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT, }, [Feature.OverlayAnalysisPython]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_PYTHON", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON, }, [Feature.OverlayAnalysisResourceChecksV2]: { defaultValue: false, @@ -298,23 +270,13 @@ export const featureConfig = { [Feature.OverlayAnalysisRuby]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUBY", - minimumVersion: undefined, - }, - [Feature.OverlayAnalysisRust]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", - minimumVersion: undefined, + minimumVersion: CODEQL_OVERLAY_MINIMUM_VERSION_RUBY, }, [Feature.OverlayAnalysisSkipResourceChecks]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", minimumVersion: undefined, }, - [Feature.OverlayAnalysisSwift]: { - defaultValue: false, - envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", - minimumVersion: undefined, - }, [Feature.PythonDefaultIsToNotExtractStdlib]: { defaultValue: false, envVar: "CODEQL_ACTION_DISABLE_PYTHON_STANDARD_LIBRARY_EXTRACTION", @@ -330,11 +292,8 @@ export const featureConfig = { [Feature.SkipFileCoverageOnPrs]: { defaultValue: false, envVar: "CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS", - // For testing, this is not behind a CLI version check yet. However - // before rolling this out externally, we should set a minimum version here - // since current versions of the CodeQL CLI will log if baseline information - // cannot be found when interpreting results. minimumVersion: undefined, + toolsFeature: ToolsFeature.SuppressesMissingFileBaselineWarning, }, [Feature.StartProxyRemoveUnusedRegistries]: { defaultValue: false, @@ -352,11 +311,6 @@ export const featureConfig = { minimumVersion: undefined, toolsFeature: ToolsFeature.BundleSupportsOverlay, }, - [Feature.UseRepositoryProperties]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: undefined, - }, [Feature.ValidateDbConfig]: { defaultValue: false, envVar: "CODEQL_ACTION_VALIDATE_DB_CONFIG", diff --git a/src/feature-flags/properties.test.ts b/src/feature-flags/properties.test.ts index afe9369325..2676c2dcda 100644 --- a/src/feature-flags/properties.test.ts +++ b/src/feature-flags/properties.test.ts @@ -4,8 +4,7 @@ import * as sinon from "sinon"; import * as api from "../api-client"; import { getRunnerLogger } from "../logging"; import { parseRepositoryNwo } from "../repository"; -import { setupTests } from "../testing-utils"; -import * as util from "../util"; +import { RecordingLogger, setupTests } from "../testing-utils"; import * as properties from "./properties"; @@ -23,13 +22,7 @@ test.serial( const logger = getRunnerLogger(true); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); await t.throwsAsync( - properties.loadPropertiesFromApi( - { - type: util.GitHubVariant.DOTCOM, - }, - logger, - mockRepositoryNwo, - ), + properties.loadPropertiesFromApi(logger, mockRepositoryNwo), { message: /Expected repository properties API to return an array/, }, @@ -38,7 +31,7 @@ test.serial( ); test.serial( - "loadPropertiesFromApi throws if response data contains unexpected objects", + "loadPropertiesFromApi throws if response data contains objects without `property_name`", async (t) => { sinon.stub(api, "getRepositoryProperties").resolves({ headers: {}, @@ -49,13 +42,7 @@ test.serial( const logger = getRunnerLogger(true); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); await t.throwsAsync( - properties.loadPropertiesFromApi( - { - type: util.GitHubVariant.DOTCOM, - }, - logger, - mockRepositoryNwo, - ), + properties.loadPropertiesFromApi(logger, mockRepositoryNwo), { message: /Expected repository property object to have a 'property_name'/, @@ -65,28 +52,22 @@ test.serial( ); test.serial( - "loadPropertiesFromApi returns empty object if on GHES", + "loadPropertiesFromApi does not throw for unexpected value types of unknown properties", async (t) => { sinon.stub(api, "getRepositoryProperties").resolves({ headers: {}, status: 200, url: "", data: [ - { property_name: "github-codeql-extra-queries", value: "+queries" }, - { property_name: "unknown-property", value: "something" }, - ] satisfies properties.GitHubPropertiesResponse, + { property_name: "not-used-by-us", value: { foo: "bar" } }, + { property_name: "also-not-used-by-us", value: ["A", "B", "C"] }, + ], }); const logger = getRunnerLogger(true); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); - const response = await properties.loadPropertiesFromApi( - { - type: util.GitHubVariant.GHES, - version: "", - }, - logger, - mockRepositoryNwo, + await t.notThrowsAsync( + properties.loadPropertiesFromApi(logger, mockRepositoryNwo), ); - t.deepEqual(response, {}); }, ); @@ -103,9 +84,6 @@ test.serial("loadPropertiesFromApi loads known properties", async (t) => { const logger = getRunnerLogger(true); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); const response = await properties.loadPropertiesFromApi( - { - type: util.GitHubVariant.DOTCOM, - }, logger, mockRepositoryNwo, ); @@ -129,9 +107,6 @@ test.serial("loadPropertiesFromApi parses true boolean property", async (t) => { const warningSpy = sinon.spy(logger, "warning"); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); const response = await properties.loadPropertiesFromApi( - { - type: util.GitHubVariant.DOTCOM, - }, logger, mockRepositoryNwo, ); @@ -160,9 +135,6 @@ test.serial( const warningSpy = sinon.spy(logger, "warning"); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); const response = await properties.loadPropertiesFromApi( - { - type: util.GitHubVariant.DOTCOM, - }, logger, mockRepositoryNwo, ); @@ -174,7 +146,7 @@ test.serial( ); test.serial( - "loadPropertiesFromApi throws if property value is not a string", + "loadPropertiesFromApi throws if known property value is not a string", async (t) => { sinon.stub(api, "getRepositoryProperties").resolves({ headers: {}, @@ -185,16 +157,10 @@ test.serial( const logger = getRunnerLogger(true); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); await t.throwsAsync( - properties.loadPropertiesFromApi( - { - type: util.GitHubVariant.DOTCOM, - }, - logger, - mockRepositoryNwo, - ), + properties.loadPropertiesFromApi(logger, mockRepositoryNwo), { message: - /Expected repository property 'github-codeql-extra-queries' to have a string value/, + /Unexpected value for repository property 'github-codeql-extra-queries' \(number\), got: 123/, }, ); }, @@ -218,9 +184,6 @@ test.serial( const warningSpy = sinon.spy(logger, "warning"); const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); const response = await properties.loadPropertiesFromApi( - { - type: util.GitHubVariant.DOTCOM, - }, logger, mockRepositoryNwo, ); @@ -234,3 +197,38 @@ test.serial( ); }, ); + +test.serial( + "loadPropertiesFromApi warns if a repository property name starts with the common prefix, but is not recognised by us", + async (t) => { + process.env["GITHUB_EVENT_NAME"] = "push"; + const propertyName: string = `${properties.GITHUB_CODEQL_PROPERTY_PREFIX}unknown`; + sinon.stub(api, "getRepositoryProperties").resolves({ + headers: {}, + status: 200, + url: "", + data: [ + { + property_name: propertyName, + value: "true", + }, + ] satisfies properties.GitHubPropertiesResponse, + }); + const logger = new RecordingLogger(); + const warningSpy = sinon.spy(logger, "warning"); + const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); + const response = await properties.loadPropertiesFromApi( + logger, + mockRepositoryNwo, + ); + t.deepEqual(response, {}); + t.true(warningSpy.calledOnce); + t.assert( + warningSpy.firstCall.args[0] + .toString() + .startsWith( + `Found repository properties ('${propertyName}'), which look like CodeQL Action repository properties`, + ), + ); + }, +); diff --git a/src/feature-flags/properties.ts b/src/feature-flags/properties.ts index 3b55fcb6a0..12ba280bec 100644 --- a/src/feature-flags/properties.ts +++ b/src/feature-flags/properties.ts @@ -1,7 +1,10 @@ +import { isDynamicWorkflow } from "../actions-util"; import { getRepositoryProperties } from "../api-client"; import { Logger } from "../logging"; import { RepositoryNwo } from "../repository"; -import { GitHubVariant, GitHubVersion } from "../util"; + +/** The common prefix that we expect all of our repository properties to have. */ +export const GITHUB_CODEQL_PROPERTY_PREFIX = "github-codeql-"; /** * Enumerates repository property names that have some meaning to us. @@ -9,27 +12,71 @@ import { GitHubVariant, GitHubVersion } from "../util"; export enum RepositoryPropertyName { DISABLE_OVERLAY = "github-codeql-disable-overlay", EXTRA_QUERIES = "github-codeql-extra-queries", + FILE_COVERAGE_ON_PRS = "github-codeql-file-coverage-on-prs", } /** Parsed types of the known repository properties. */ -type AllRepositoryProperties = { +export type AllRepositoryProperties = { [RepositoryPropertyName.DISABLE_OVERLAY]: boolean; [RepositoryPropertyName.EXTRA_QUERIES]: string; + [RepositoryPropertyName.FILE_COVERAGE_ON_PRS]: boolean; }; /** Parsed repository properties. */ export type RepositoryProperties = Partial; +/** Maps known repository properties to the type we expect to get from the API. */ +export type RepositoryPropertyApiType = { + [RepositoryPropertyName.DISABLE_OVERLAY]: string; + [RepositoryPropertyName.EXTRA_QUERIES]: string; + [RepositoryPropertyName.FILE_COVERAGE_ON_PRS]: string; +}; + +/** The type of functions which take the `value` from the API and try to convert it to the type we want. */ +export type PropertyParser = ( + name: K, + value: RepositoryPropertyApiType[K], + logger: Logger, +) => AllRepositoryProperties[K]; + +/** Possible types of `value`s we get from the API. */ +export type RepositoryPropertyValue = string | string[]; + +/** The type of repository property configurations. */ +export type PropertyInfo = { + /** A validator which checks that the value received from the API is what we expect. */ + validate: ( + value: RepositoryPropertyValue, + ) => value is RepositoryPropertyApiType[K]; + /** A `PropertyParser` for the property. */ + parse: PropertyParser; +}; + +/** Determines whether a value from the API is a string or not. */ +function isString(value: RepositoryPropertyValue): value is string { + return typeof value === "string"; +} + +/** A repository property that we expect to contain a string value. */ +const stringProperty = { + validate: isString, + parse: parseStringRepositoryProperty, +}; + +/** A repository property that we expect to contain a boolean value. */ +const booleanProperty = { + // The value from the API should come as a string, which we then parse into a boolean. + validate: isString, + parse: parseBooleanRepositoryProperty, +}; + /** Parsers that transform repository properties from the API response into typed values. */ const repositoryPropertyParsers: { - [K in RepositoryPropertyName]: ( - name: K, - value: string, - logger: Logger, - ) => AllRepositoryProperties[K]; + [K in RepositoryPropertyName]: PropertyInfo; } = { - [RepositoryPropertyName.DISABLE_OVERLAY]: parseBooleanRepositoryProperty, - [RepositoryPropertyName.EXTRA_QUERIES]: parseStringRepositoryProperty, + [RepositoryPropertyName.DISABLE_OVERLAY]: booleanProperty, + [RepositoryPropertyName.EXTRA_QUERIES]: stringProperty, + [RepositoryPropertyName.FILE_COVERAGE_ON_PRS]: booleanProperty, }; /** @@ -37,7 +84,7 @@ const repositoryPropertyParsers: { */ export interface GitHubRepositoryProperty { property_name: string; - value: string; + value: RepositoryPropertyValue; } /** @@ -53,16 +100,9 @@ export type GitHubPropertiesResponse = GitHubRepositoryProperty[]; * @returns Returns a partial mapping from `RepositoryPropertyName` to values. */ export async function loadPropertiesFromApi( - gitHubVersion: GitHubVersion, logger: Logger, repositoryNwo: RepositoryNwo, ): Promise { - // TODO: To be safe for now; later we should replace this with a version check once we know - // which version of GHES we expect this to be supported by. - if (gitHubVersion.type === GitHubVariant.GHES) { - return {}; - } - try { const response = await getRepositoryProperties(repositoryNwo); const remoteProperties = response.data as GitHubPropertiesResponse; @@ -78,6 +118,8 @@ export async function loadPropertiesFromApi( ); const properties: RepositoryProperties = {}; + const unrecognisedProperties: string[] = []; + for (const property of remoteProperties) { if (property.property_name === undefined) { throw new Error( @@ -85,14 +127,13 @@ export async function loadPropertiesFromApi( ); } - if (typeof property.value !== "string") { - throw new Error( - `Expected repository property '${property.property_name}' to have a string value, but got: ${JSON.stringify(property)}`, - ); - } - if (isKnownPropertyName(property.property_name)) { setProperty(properties, property.property_name, property.value, logger); + } else if ( + property.property_name.startsWith(GITHUB_CODEQL_PROPERTY_PREFIX) && + !isDynamicWorkflow() + ) { + unrecognisedProperties.push(property.property_name); } } @@ -109,6 +150,20 @@ export async function loadPropertiesFromApi( } } + // Emit a warning if we encountered unrecognised properties that have our prefix. + if (unrecognisedProperties.length > 0) { + const unrecognisedPropertyList = unrecognisedProperties + .map((name) => `'${name}'`) + .join(", "); + + logger.warning( + `Found repository properties (${unrecognisedPropertyList}), ` + + "which look like CodeQL Action repository properties, " + + "but which are not understood by this version of the CodeQL Action. " + + "Do you need to update to a newer version?", + ); + } + return properties; } catch (e) { throw new Error( @@ -117,14 +172,30 @@ export async function loadPropertiesFromApi( } } -/** Update the partial set of repository properties with the parsed value of the specified property. */ +/** + * Validate that `value` has the correct type for `K` and, if so, update the partial set of repository + * properties with the parsed value of the specified property. + */ function setProperty( properties: RepositoryProperties, name: K, - value: string, + value: RepositoryPropertyValue, logger: Logger, ): void { - properties[name] = repositoryPropertyParsers[name](name, value, logger); + const propertyOptions = repositoryPropertyParsers[name]; + + // We perform the validation here for two reasons: + // 1. This function is only called if `name` is a property we care about, to avoid throwing + // on unrelated properties that may use representations we do not support. + // 2. The `propertyOptions.validate` function checks that the type of `value` we received from + // the API is what expect and narrows the type accordingly, allowing us to call `parse`. + if (propertyOptions.validate(value)) { + properties[name] = propertyOptions.parse(name, value, logger); + } else { + throw new Error( + `Unexpected value for repository property '${name}' (${typeof value}), got: ${JSON.stringify(value)}`, + ); + } } /** Parse a boolean repository property. */ diff --git a/src/fingerprints.ts b/src/fingerprints.ts index 013ba65f57..14cf30e63f 100644 --- a/src/fingerprints.ts +++ b/src/fingerprints.ts @@ -4,6 +4,7 @@ import path from "path"; import Long from "long"; import { DocUrl } from "./doc-url"; +import * as json from "./json"; import { Logger } from "./logging"; import type * as sarif from "./sarif"; @@ -189,7 +190,7 @@ export function resolveUriToFile( typeof location.index !== "number" || location.index < 0 || location.index >= artifacts.length || - typeof artifacts[location.index].location !== "object" + !json.isObject(artifacts[location.index].location) ) { logger.debug(`Ignoring location as index "${location.index}" is invalid`); return undefined; diff --git a/src/init-action-post-helper.test.ts b/src/init-action-post-helper.test.ts index e9b72332b6..a6f17948e3 100644 --- a/src/init-action-post-helper.test.ts +++ b/src/init-action-post-helper.test.ts @@ -1,10 +1,13 @@ +import * as core from "@actions/core"; import test, { ExecutionContext } from "ava"; import * as sinon from "sinon"; import * as actionsUtil from "./actions-util"; import { AnalysisKind } from "./analyses"; +import * as apiClient from "./api-client"; import * as codeql from "./codeql"; import * as configUtils from "./config-utils"; +import * as debugArtifacts from "./debug-artifacts"; import { EnvVar } from "./environment"; import { Feature } from "./feature-flags"; import * as initActionPostHelper from "./init-action-post-helper"; @@ -17,6 +20,7 @@ import { createTestConfig, DEFAULT_ACTIONS_VARS, makeVersionInfo, + RecordingLogger, setupActionsVars, setupTests, } from "./testing-utils"; @@ -46,7 +50,7 @@ test.serial("init-post action with debug mode off", async (t) => { const uploadAllAvailableDebugArtifactsSpy = sinon.spy(); const printDebugLogsSpy = sinon.spy(); - await initActionPostHelper.run( + await initActionPostHelper.uploadFailureInfo( uploadAllAvailableDebugArtifactsSpy, printDebugLogsSpy, codeql.createStubCodeQL({}), @@ -68,7 +72,7 @@ test.serial("init-post action with debug mode on", async (t) => { const uploadAllAvailableDebugArtifactsSpy = sinon.spy(); const printDebugLogsSpy = sinon.spy(); - await initActionPostHelper.run( + await initActionPostHelper.uploadFailureInfo( uploadAllAvailableDebugArtifactsSpy, printDebugLogsSpy, codeql.createStubCodeQL({}), @@ -334,7 +338,7 @@ test.serial( }); t.is( result.upload_failed_run_skipped_because, - "Code Scanning is not enabled.", + "No analysis kind that supports failed SARIF uploads is enabled.", ); }, ); @@ -359,7 +363,7 @@ test.serial( const stubCodeQL = codeql.createStubCodeQL({}); - await initActionPostHelper.run( + await initActionPostHelper.uploadFailureInfo( sinon.spy(), sinon.spy(), stubCodeQL, @@ -427,7 +431,7 @@ test.serial( .stub(overlayStatus, "saveOverlayStatus") .resolves(true); - await initActionPostHelper.run( + await initActionPostHelper.uploadFailureInfo( sinon.spy(), sinon.spy(), codeql.createStubCodeQL({}), @@ -464,7 +468,7 @@ test.serial("does not save overlay status when build successful", async (t) => { .stub(overlayStatus, "saveOverlayStatus") .resolves(true); - await initActionPostHelper.run( + await initActionPostHelper.uploadFailureInfo( sinon.spy(), sinon.spy(), codeql.createStubCodeQL({}), @@ -501,7 +505,7 @@ test.serial( .stub(overlayStatus, "saveOverlayStatus") .resolves(true); - await initActionPostHelper.run( + await initActionPostHelper.uploadFailureInfo( sinon.spy(), sinon.spy(), codeql.createStubCodeQL({}), @@ -658,3 +662,197 @@ async function testFailedSarifUpload( } return result; } + +const singleLanguageMatrix = JSON.stringify({ + language: "javascript", + category: "/language:javascript", + "build-mode": "none", + runner: "ubuntu-latest", +}); + +async function mockRiskAssessmentEnv(matrix: string) { + process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] = "false"; + process.env["GITHUB_JOB"] = "analyze"; + process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; + process.env["GITHUB_WORKSPACE"] = + "/home/runner/work/codeql-action-fake-repository/codeql-action-fake-repository"; + + sinon + .stub(apiClient, "getGitHubVersion") + .resolves({ type: util.GitHubVariant.GHES, version: "3.0.0" }); + + const codeqlObject = await codeql.getCodeQLForTesting(); + const databaseExportDiagnostics = sinon + .stub(codeqlObject, "databaseExportDiagnostics") + .resolves(); + const diagnosticsExport = sinon + .stub(codeqlObject, "diagnosticsExport") + .resolves(); + + sinon.stub(codeql, "getCodeQL").resolves(codeqlObject); + + sinon.stub(core, "getInput").withArgs("matrix").returns(matrix); + + const uploadArtifact = sinon.stub().resolves(); + const artifactClient = { uploadArtifact }; + sinon + .stub(debugArtifacts, "getArtifactUploaderClient") + .value(() => artifactClient); + + return { uploadArtifact, databaseExportDiagnostics, diagnosticsExport }; +} + +test.serial( + "tryUploadSarifIfRunFailed - uploads as artifact for risk assessments (diagnosticsExport)", + async (t) => { + const logger = new RecordingLogger(); + const { uploadArtifact, databaseExportDiagnostics, diagnosticsExport } = + await mockRiskAssessmentEnv(singleLanguageMatrix); + + const config = createTestConfig({ + analysisKinds: [AnalysisKind.RiskAssessment], + codeQLCmd: "codeql-for-testing", + languages: ["javascript"], + }); + const features = createFeatures([]); + + const result = await initActionPostHelper.tryUploadSarifIfRunFailed( + config, + parseRepositoryNwo("github/codeql-action-fake-repository"), + features, + logger, + ); + + const expectedName = debugArtifacts.sanitizeArtifactName( + `sarif-artifact-${debugArtifacts.getArtifactSuffix(singleLanguageMatrix)}`, + ); + const expectedFilePattern = /codeql-failed-sarif-javascript\.csra\.sarif$/; + t.is(result.upload_failed_run_skipped_because, undefined); + t.is(result.upload_failed_run_error, undefined); + t.is(result.sarifID, expectedName); + t.assert( + uploadArtifact.calledOnceWith( + expectedName, + [sinon.match(expectedFilePattern)], + sinon.match.string, + ), + ); + t.assert(databaseExportDiagnostics.notCalled); + t.assert( + diagnosticsExport.calledOnceWith( + sinon.match(expectedFilePattern), + "/language:javascript", + config, + ), + ); + }, +); + +test.serial( + "tryUploadSarifIfRunFailed - uploads as artifact for risk assessments (databaseExportDiagnostics)", + async (t) => { + const logger = new RecordingLogger(); + const { uploadArtifact, databaseExportDiagnostics, diagnosticsExport } = + await mockRiskAssessmentEnv(singleLanguageMatrix); + + const dbLocation = "/some/path"; + const config = createTestConfig({ + analysisKinds: [AnalysisKind.RiskAssessment], + codeQLCmd: "codeql-for-testing", + languages: ["javascript"], + dbLocation: "/some/path", + }); + const features = createFeatures([Feature.ExportDiagnosticsEnabled]); + + const result = await initActionPostHelper.tryUploadSarifIfRunFailed( + config, + parseRepositoryNwo("github/codeql-action-fake-repository"), + features, + logger, + ); + + const expectedName = debugArtifacts.sanitizeArtifactName( + `sarif-artifact-${debugArtifacts.getArtifactSuffix(singleLanguageMatrix)}`, + ); + const expectedFilePattern = /codeql-failed-sarif-javascript\.csra\.sarif$/; + t.is(result.upload_failed_run_skipped_because, undefined); + t.is(result.upload_failed_run_error, undefined); + t.is(result.sarifID, expectedName); + t.assert( + uploadArtifact.calledOnceWith( + expectedName, + [sinon.match(expectedFilePattern)], + sinon.match.string, + ), + ); + t.assert(diagnosticsExport.notCalled); + t.assert( + databaseExportDiagnostics.calledOnceWith( + dbLocation, + sinon.match(expectedFilePattern), + "/language:javascript", + ), + ); + }, +); + +const skippedUploadTest = test.macro({ + exec: async ( + t: ExecutionContext, + config: Partial, + expectedSkippedReason: string, + ) => { + const logger = new RecordingLogger(); + const { uploadArtifact, diagnosticsExport } = + await mockRiskAssessmentEnv(singleLanguageMatrix); + const features = createFeatures([]); + + const result = await initActionPostHelper.tryUploadSarifIfRunFailed( + createTestConfig(config), + parseRepositoryNwo("github/codeql-action-fake-repository"), + features, + logger, + ); + + t.is(result.upload_failed_run_skipped_because, expectedSkippedReason); + t.assert(uploadArtifact.notCalled); + t.assert(diagnosticsExport.notCalled); + }, + + title: (providedTitle: string = "") => + `tryUploadSarifIfRunFailed - skips upload ${providedTitle}`, +}); + +test.serial( + "without CodeQL command", + skippedUploadTest, + // No codeQLCmd + { + analysisKinds: [AnalysisKind.RiskAssessment], + languages: ["javascript"], + } satisfies Partial, + "CodeQL command not found", +); + +test.serial( + "if no language is configured", + skippedUploadTest, + // No explicit language configuration + { + analysisKinds: [AnalysisKind.RiskAssessment], + codeQLCmd: "codeql-for-testing", + } satisfies Partial, + "Unexpectedly, the configuration is not for a single language.", +); + +test.serial( + "if multiple languages is configured", + skippedUploadTest, + // Multiple explicit languages configured + { + analysisKinds: [AnalysisKind.RiskAssessment], + codeQLCmd: "codeql-for-testing", + languages: ["javascript", "python"], + } satisfies Partial, + "Unexpectedly, the configuration is not for a single language.", +); diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index a8f7a8731d..0c97a947af 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -1,12 +1,22 @@ import * as fs from "fs"; +import path from "path"; import * as github from "@actions/github"; import * as actionsUtil from "./actions-util"; -import { CodeScanning } from "./analyses"; -import { getApiClient } from "./api-client"; +import { CodeScanning, RiskAssessment } from "./analyses"; +import { getApiClient, getGitHubVersion } from "./api-client"; import { CodeQL, getCodeQL } from "./codeql"; -import { Config, isCodeScanningEnabled } from "./config-utils"; +import { + Config, + isCodeScanningEnabled, + isRiskAssessmentEnabled, +} from "./config-utils"; +import { + getArtifactSuffix, + getArtifactUploaderClient, + sanitizeArtifactName, +} from "./debug-artifacts"; import * as dependencyCaching from "./dependency-caching"; import { EnvVar } from "./environment"; import { Feature, FeatureEnablement } from "./feature-flags"; @@ -23,10 +33,13 @@ import * as uploadLib from "./upload-lib"; import { checkDiskUsage, delay, + Failure, getErrorMessage, getRequiredEnvParam, parseMatrixInput, + Result, shouldSkipSarifUpload, + Success, wrapError, } from "./util"; import { @@ -66,37 +79,96 @@ function createFailedUploadFailedSarifResult( }; } +/** Records details about a SARIF file that contains information about a failed analysis. */ +interface FailedSarifInfo { + sarifFile: string; + category: string | undefined; + checkoutPath: string; +} + /** - * Upload a failed SARIF file if we can verify that SARIF upload is enabled and determine the SARIF - * category for the workflow. + * Tries to prepare a SARIF file that contains information about a failed analysis. + * + * @returns Either information about the SARIF file that was produced, or a reason why it couldn't be produced. */ -async function maybeUploadFailedSarif( - config: Config, - repositoryNwo: RepositoryNwo, - features: FeatureEnablement, +async function prepareFailedSarif( logger: Logger, -): Promise { + features: FeatureEnablement, + config: Config, +): Promise> { if (!config.codeQLCmd) { - return { upload_failed_run_skipped_because: "CodeQL command not found" }; + return new Failure({ + upload_failed_run_skipped_because: "CodeQL command not found", + }); } - const workflow = await getWorkflow(logger); const jobName = getRequiredEnvParam("GITHUB_JOB"); const matrix = parseMatrixInput(actionsUtil.getRequiredInput("matrix")); - const shouldUpload = getUploadInputOrThrow(workflow, jobName, matrix); - if ( - !["always", "failure-only"].includes( - actionsUtil.getUploadValue(shouldUpload), - ) || - shouldSkipSarifUpload() - ) { - return { upload_failed_run_skipped_because: "SARIF upload is disabled" }; + + if (shouldSkipSarifUpload()) { + return new Failure({ + upload_failed_run_skipped_because: "SARIF upload is disabled", + }); } - const category = getCategoryInputOrThrow(workflow, jobName, matrix); - const checkoutPath = getCheckoutPathInputOrThrow(workflow, jobName, matrix); - const databasePath = config.dbLocation; + if (isRiskAssessmentEnabled(config)) { + if (config.languages.length !== 1) { + return new Failure({ + upload_failed_run_skipped_because: + "Unexpectedly, the configuration is not for a single language.", + }); + } + + // We can make these assumptions for risk assessments. + const language = config.languages[0]; + const category = `/language:${language}`; + const checkoutPath = "."; + const result = await generateFailedSarif( + features, + config, + category, + checkoutPath, + `../codeql-failed-sarif-${language}${RiskAssessment.sarifExtension}`, + ); + return new Success(result); + } else { + const workflow = await getWorkflow(logger); + const shouldUpload = getUploadInputOrThrow(workflow, jobName, matrix); + if ( + !["always", "failure-only"].includes( + actionsUtil.getUploadValue(shouldUpload), + ) + ) { + return new Failure({ + upload_failed_run_skipped_because: "SARIF upload is disabled", + }); + } + const category = getCategoryInputOrThrow(workflow, jobName, matrix); + const checkoutPath = getCheckoutPathInputOrThrow(workflow, jobName, matrix); + + const result = await generateFailedSarif( + features, + config, + category, + checkoutPath, + ); + return new Success(result); + } +} + +async function generateFailedSarif( + features: FeatureEnablement, + config: Config, + category: string | undefined, + checkoutPath: string, + sarifFile?: string, +) { + const databasePath = config.dbLocation; const codeql = await getCodeQL(config.codeQLCmd); - const sarifFile = "../codeql-failed-run.sarif"; + + // Set the filename for the SARIF file if not already set. + if (sarifFile === undefined) { + sarifFile = "../codeql-failed-run.sarif"; + } // If there is no database or the feature flag is off, we run 'export diagnostics' if ( @@ -109,11 +181,32 @@ async function maybeUploadFailedSarif( await codeql.databaseExportDiagnostics(databasePath, sarifFile, category); } - logger.info(`Uploading failed SARIF file ${sarifFile}`); + return { sarifFile, category, checkoutPath }; +} + +/** + * Upload a failed SARIF file if we can verify that SARIF upload is enabled and determine the SARIF + * category for the workflow. + */ +async function maybeUploadFailedSarif( + config: Config, + repositoryNwo: RepositoryNwo, + features: FeatureEnablement, + logger: Logger, +): Promise { + const failedSarifResult = await prepareFailedSarif(logger, features, config); + + if (failedSarifResult.isFailure()) { + return failedSarifResult.value; + } + + const failedSarif = failedSarifResult.value; + + logger.info(`Uploading failed SARIF file ${failedSarif.sarifFile}`); const uploadResult = await uploadLib.uploadFiles( - sarifFile, - checkoutPath, - category, + failedSarif.sarifFile, + failedSarif.checkoutPath, + failedSarif.category, features, logger, CodeScanning, @@ -129,31 +222,78 @@ async function maybeUploadFailedSarif( : {}; } +/** Uploads a failed SARIF file as workflow artifact, if it can be generated. */ +async function maybeUploadFailedSarifArtifact( + config: Config, + features: FeatureEnablement, + logger: Logger, +): Promise { + const failedSarifResult = await prepareFailedSarif(logger, features, config); + + if (failedSarifResult.isFailure()) { + return failedSarifResult.value; + } + + const failedSarif = failedSarifResult.value; + + logger.info( + `Uploading failed SARIF file ${failedSarif.sarifFile} as artifact`, + ); + + const gitHubVersion = await getGitHubVersion(); + const client = await getArtifactUploaderClient(logger, gitHubVersion.type); + + const suffix = getArtifactSuffix(actionsUtil.getOptionalInput("matrix")); + const name = sanitizeArtifactName(`sarif-artifact-${suffix}`); + await client.uploadArtifact( + name, + [path.normalize(failedSarif.sarifFile)], + path.normalize(".."), + ); + + return { sarifID: name }; +} + +/** + * Tries to upload a SARIF file with information about the run, if it failed. + * + * @param config The CodeQL Action configuration. + * @param repositoryNwo The name and owner of the repository. + * @param features Information about enabled features. + * @param logger The logger to use. + * @returns The results of uploading the SARIF file for the failure. + */ export async function tryUploadSarifIfRunFailed( config: Config, repositoryNwo: RepositoryNwo, features: FeatureEnablement, logger: Logger, ): Promise { - // Only upload the failed SARIF to Code scanning if Code scanning is enabled. - if (!isCodeScanningEnabled(config)) { - return { - upload_failed_run_skipped_because: "Code Scanning is not enabled.", - }; - } + // There's nothing to do here if the analysis succeeded. if (process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] === "true") { return { upload_failed_run_skipped_because: "Analyze Action completed successfully", }; } + try { - return await maybeUploadFailedSarif( - config, - repositoryNwo, - features, - logger, - ); + // Only upload the failed SARIF to Code scanning if Code scanning is enabled. + if (isCodeScanningEnabled(config)) { + return await maybeUploadFailedSarif( + config, + repositoryNwo, + features, + logger, + ); + } else if (isRiskAssessmentEnabled(config)) { + return await maybeUploadFailedSarifArtifact(config, features, logger); + } else { + return { + upload_failed_run_skipped_because: + "No analysis kind that supports failed SARIF uploads is enabled.", + }; + } } catch (e) { logger.debug( `Failed to upload a SARIF file for this failed CodeQL code scanning run. ${e}`, @@ -162,7 +302,21 @@ export async function tryUploadSarifIfRunFailed( } } -export async function run( +/** + * Handles the majority of the `post-init` step logic which, depending on the configuration, + * mainly involves uploading a SARIF file with information about the failed run, debug + * artifacts, and performing clean-up operations. + * + * @param uploadAllAvailableDebugArtifacts A function with which to upload debug artifacts. + * @param printDebugLogs A function with which to print debug logs. + * @param codeql The CodeQL CLI instance. + * @param config The CodeQL Action configuration. + * @param repositoryNwo The name and owner of the repository. + * @param features Information about enabled features. + * @param logger The logger to use. + * @returns The results of uploading the SARIF file for the failure. + */ +export async function uploadFailureInfo( uploadAllAvailableDebugArtifacts: ( codeql: CodeQL, config: Config, @@ -175,7 +329,7 @@ export async function run( repositoryNwo: RepositoryNwo, features: FeatureEnablement, logger: Logger, -) { +): Promise { await recordOverlayStatus(codeql, config, features, logger); const uploadFailedSarifResult = await tryUploadSarifIfRunFailed( @@ -187,7 +341,7 @@ export async function run( if (uploadFailedSarifResult.upload_failed_run_skipped_because) { logger.debug( - "Won't upload a failed SARIF file for this CodeQL code scanning run because: " + + "Won't upload a failed SARIF file for this CodeQL analysis because: " + `${uploadFailedSarifResult.upload_failed_run_skipped_because}.`, ); } diff --git a/src/init-action-post.ts b/src/init-action-post.ts index d5aab32f33..ed99701707 100644 --- a/src/init-action-post.ts +++ b/src/init-action-post.ts @@ -77,7 +77,7 @@ async function run(startedAt: Date) { } else { const codeql = await getCodeQL(config.codeQLCmd); - uploadFailedSarifResult = await initActionPostHelper.run( + uploadFailedSarifResult = await initActionPostHelper.uploadFailureInfo( debugArtifacts.tryUploadAllAvailableDebugArtifacts, printDebugLogs, codeql, diff --git a/src/init-action.ts b/src/init-action.ts index 7bd749e826..56902a4379 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -48,6 +48,7 @@ import { checkPacksForOverlayCompatibility, cleanupDatabaseClusterDirectory, getFileCoverageInformationEnabled, + logFileCoverageOnPrsDeprecationWarning, initCodeQL, initConfig, runDatabaseInitCluster, @@ -93,7 +94,6 @@ import { checkActionVersion, getErrorMessage, BuildMode, - GitHubVersion, Result, getOptionalEnvVar, Success, @@ -250,8 +250,6 @@ async function run(startedAt: Date) { // Fetch the values of known repository properties that affect us. const repositoryPropertiesResult = await loadRepositoryProperties( repositoryNwo, - gitHubVersion, - features, logger, ); @@ -346,6 +344,14 @@ async function run(startedAt: Date) { analysisKinds = await getAnalysisKinds(logger); const debugMode = getOptionalInput("debug") === "true" || core.isDebug(); + const repositoryProperties = repositoryPropertiesResult.orElse({}); + const fileCoverageResult = await getFileCoverageInformationEnabled( + debugMode, + codeql, + features, + repositoryProperties, + ); + config = await initConfig(features, { analysisKinds, languagesInput: getOptionalInput("languages"), @@ -375,12 +381,8 @@ async function run(startedAt: Date) { githubVersion: gitHubVersion, apiDetails, features, - repositoryProperties: repositoryPropertiesResult.orElse({}), - enableFileCoverageInformation: await getFileCoverageInformationEnabled( - debugMode, - repositoryNwo, - features, - ), + repositoryProperties, + enableFileCoverageInformation: fileCoverageResult.enabled, logger, }); @@ -397,6 +399,21 @@ async function run(startedAt: Date) { ); } + if (fileCoverageResult.enabledByRepositoryProperty) { + addNoLanguageDiagnostic( + config, + makeTelemetryDiagnostic( + "codeql-action/file-coverage-on-prs-enabled-by-repository-property", + "File coverage on PRs enabled by repository property", + {}, + ), + ); + } + + if (fileCoverageResult.showDeprecationWarning) { + logFileCoverageOnPrsDeprecationWarning(logger); + } + await checkInstallPython311(config.languages, codeql); } catch (unwrappedError) { const error = wrapError(unwrappedError); @@ -820,8 +837,6 @@ async function run(startedAt: Date) { */ async function loadRepositoryProperties( repositoryNwo: RepositoryNwo, - gitHubVersion: GitHubVersion, - features: FeatureEnablement, logger: Logger, ): Promise> { // See if we can skip loading repository properties early. In particular, @@ -839,17 +854,8 @@ async function loadRepositoryProperties( return new Success({}); } - if (!(await features.getValue(Feature.UseRepositoryProperties))) { - logger.debug( - "Skipping loading repository properties because the UseRepositoryProperties feature flag is disabled.", - ); - return new Success({}); - } - try { - return new Success( - await loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo), - ); + return new Success(await loadPropertiesFromApi(logger, repositoryNwo)); } catch (error) { logger.warning( `Failed to load repository properties: ${getErrorMessage(error)}`, diff --git a/src/init.test.ts b/src/init.test.ts index a7d4f4de17..1f1f0de8dd 100644 --- a/src/init.test.ts +++ b/src/init.test.ts @@ -1,6 +1,8 @@ import * as fs from "fs"; import path from "path"; +import * as core from "@actions/core"; +import * as github from "@actions/github"; import test, { ExecutionContext } from "ava"; import * as sinon from "sinon"; @@ -11,9 +13,9 @@ import { checkPacksForOverlayCompatibility, cleanupDatabaseClusterDirectory, getFileCoverageInformationEnabled, + logFileCoverageOnPrsDeprecationWarning, } from "./init"; import { KnownLanguage } from "./languages"; -import { parseRepositoryNwo } from "./repository"; import { createFeatures, LoggedMessage, @@ -453,13 +455,15 @@ test( ); test("file coverage information enabled when debugMode is true", async (t) => { - t.true( - await getFileCoverageInformationEnabled( - true, // debugMode - parseRepositoryNwo("github/codeql-action"), - createFeatures([Feature.SkipFileCoverageOnPrs]), - ), + const result = await getFileCoverageInformationEnabled( + true, // debugMode + createStubCodeQL({}), + createFeatures([Feature.SkipFileCoverageOnPrs]), + {}, ); + t.true(result.enabled); + t.false(result.enabledByRepositoryProperty); + t.false(result.showDeprecationWarning); }); test.serial( @@ -467,43 +471,69 @@ test.serial( async (t) => { sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(false); - t.true( - await getFileCoverageInformationEnabled( - false, // debugMode - parseRepositoryNwo("github/codeql-action"), - createFeatures([Feature.SkipFileCoverageOnPrs]), - ), + const result = await getFileCoverageInformationEnabled( + false, // debugMode + createStubCodeQL({}), + createFeatures([Feature.SkipFileCoverageOnPrs]), + {}, ); + t.true(result.enabled); + t.false(result.enabledByRepositoryProperty); + t.false(result.showDeprecationWarning); }, ); test.serial( - "file coverage information enabled when owner is not 'github'", + "file coverage information enabled when feature flag is not enabled, with deprecation warning", async (t) => { sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(true); - t.true( - await getFileCoverageInformationEnabled( - false, // debugMode - parseRepositoryNwo("other-org/some-repo"), - createFeatures([Feature.SkipFileCoverageOnPrs]), - ), + const result = await getFileCoverageInformationEnabled( + false, // debugMode + createStubCodeQL({}), + createFeatures([]), + {}, ); + t.true(result.enabled); + t.false(result.enabledByRepositoryProperty); + t.true(result.showDeprecationWarning); }, ); test.serial( - "file coverage information enabled when feature flag is not enabled", + "file coverage information enabled when repository property is set", async (t) => { sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(true); - t.true( - await getFileCoverageInformationEnabled( - false, // debugMode - parseRepositoryNwo("github/codeql-action"), - createFeatures([]), - ), + const result = await getFileCoverageInformationEnabled( + false, // debugMode + createStubCodeQL({}), + createFeatures([Feature.SkipFileCoverageOnPrs]), + { + "github-codeql-file-coverage-on-prs": true, + }, ); + t.true(result.enabled); + t.true(result.enabledByRepositoryProperty); + t.false(result.showDeprecationWarning); + }, +); + +test.serial( + "file coverage information enabled when env var opt-out is set", + async (t) => { + sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(true); + process.env["CODEQL_ACTION_FILE_COVERAGE_ON_PRS"] = "true"; + + const result = await getFileCoverageInformationEnabled( + false, // debugMode + createStubCodeQL({}), + createFeatures([Feature.SkipFileCoverageOnPrs]), + {}, + ); + t.true(result.enabled); + t.false(result.enabledByRepositoryProperty); + t.false(result.showDeprecationWarning); }, ); @@ -512,12 +542,174 @@ test.serial( async (t) => { sinon.stub(actionsUtil, "isAnalyzingPullRequest").returns(true); - t.false( - await getFileCoverageInformationEnabled( - false, // debugMode - parseRepositoryNwo("github/codeql-action"), - createFeatures([Feature.SkipFileCoverageOnPrs]), - ), + const result = await getFileCoverageInformationEnabled( + false, // debugMode + createStubCodeQL({}), + createFeatures([Feature.SkipFileCoverageOnPrs]), + {}, + ); + t.false(result.enabled); + t.false(result.enabledByRepositoryProperty); + t.false(result.showDeprecationWarning); + }, +); + +test.serial( + "file coverage deprecation warning for org-owned repo with default setup recommends repo property", + (t) => { + const exportVariableStub = sinon.stub(core, "exportVariable"); + sinon.stub(actionsUtil, "isDefaultSetup").returns(true); + github.context.payload = { + repository: { + name: "test-repo", + owner: { login: "test-org", type: "Organization" }, + }, + }; + const messages: LoggedMessage[] = []; + logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages)); + t.is(messages.length, 1); + t.is(messages[0].type, "warning"); + t.is( + messages[0].message, + "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " + + "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" + + "To opt out of this change, create a custom repository property " + + 'with the name `github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to ' + + "`true` in the repository's settings.", + ); + t.true(exportVariableStub.calledOnce); + }, +); + +test.serial( + "file coverage deprecation warning for org-owned repo with advanced setup recommends env var and repo property", + (t) => { + const exportVariableStub = sinon.stub(core, "exportVariable"); + sinon.stub(actionsUtil, "isDefaultSetup").returns(false); + github.context.payload = { + repository: { + name: "test-repo", + owner: { login: "test-org", type: "Organization" }, + }, + }; + const messages: LoggedMessage[] = []; + logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages)); + t.is(messages.length, 1); + t.is(messages[0].type, "warning"); + t.is( + messages[0].message, + "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " + + "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" + + "To opt out of this change, set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`. " + + "Alternatively, create a custom repository property " + + 'with the name `github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to ' + + "`true` in the repository's settings.", ); + t.true(exportVariableStub.calledOnce); + }, +); + +test.serial( + "file coverage deprecation warning for user-owned repo with default setup recommends advanced setup", + (t) => { + const exportVariableStub = sinon.stub(core, "exportVariable"); + sinon.stub(actionsUtil, "isDefaultSetup").returns(true); + github.context.payload = { + repository: { + name: "test-repo", + owner: { login: "test-user", type: "User" }, + }, + }; + const messages: LoggedMessage[] = []; + logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages)); + t.is(messages.length, 1); + t.is(messages[0].type, "warning"); + t.is( + messages[0].message, + "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " + + "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" + + "To opt out of this change, switch to an advanced setup workflow and " + + "set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`.", + ); + t.true(exportVariableStub.calledOnce); + }, +); + +test.serial( + "file coverage deprecation warning for user-owned repo with advanced setup recommends env var", + (t) => { + const exportVariableStub = sinon.stub(core, "exportVariable"); + sinon.stub(actionsUtil, "isDefaultSetup").returns(false); + github.context.payload = { + repository: { + name: "test-repo", + owner: { login: "test-user", type: "User" }, + }, + }; + const messages: LoggedMessage[] = []; + logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages)); + t.is(messages.length, 1); + t.is(messages[0].type, "warning"); + t.is( + messages[0].message, + "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " + + "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" + + "To opt out of this change, set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`.", + ); + t.true(exportVariableStub.calledOnce); + }, +); + +test.serial( + "file coverage deprecation warning for unknown owner type with default setup recommends advanced setup", + (t) => { + const exportVariableStub = sinon.stub(core, "exportVariable"); + sinon.stub(actionsUtil, "isDefaultSetup").returns(true); + github.context.payload = { repository: undefined }; + const messages: LoggedMessage[] = []; + logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages)); + t.is(messages.length, 1); + t.is(messages[0].type, "warning"); + t.is( + messages[0].message, + "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " + + "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" + + "To opt out of this change, switch to an advanced setup workflow and " + + "set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`.", + ); + t.true(exportVariableStub.calledOnce); + }, +); + +test.serial( + "file coverage deprecation warning for unknown owner type with advanced setup recommends env var", + (t) => { + const exportVariableStub = sinon.stub(core, "exportVariable"); + sinon.stub(actionsUtil, "isDefaultSetup").returns(false); + github.context.payload = { repository: undefined }; + const messages: LoggedMessage[] = []; + logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages)); + t.is(messages.length, 1); + t.is(messages[0].type, "warning"); + t.is( + messages[0].message, + "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " + + "to improve analysis performance. File coverage information will still be computed on non-PR analyses.\n\n" + + "To opt out of this change, set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`.", + ); + t.true(exportVariableStub.calledOnce); + }, +); + +test.serial( + "logFileCoverageOnPrsDeprecationWarning does not log if already logged", + (t) => { + process.env["CODEQL_ACTION_DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION"] = + "true"; + const exportVariableStub = sinon.stub(core, "exportVariable"); + const messages: LoggedMessage[] = []; + logFileCoverageOnPrsDeprecationWarning(getRecordingLogger(messages)); + t.is(messages.length, 0); + t.true(exportVariableStub.notCalled); }, ); diff --git a/src/init.ts b/src/init.ts index a5c8e9ec02..8e3fa21a4a 100644 --- a/src/init.ts +++ b/src/init.ts @@ -1,26 +1,33 @@ import * as fs from "fs"; import * as path from "path"; +import * as core from "@actions/core"; import * as toolrunner from "@actions/exec/lib/toolrunner"; +import * as github from "@actions/github"; import * as io from "@actions/io"; import * as yaml from "js-yaml"; import { getOptionalInput, isAnalyzingPullRequest, + isDefaultSetup, isSelfHostedRunner, } from "./actions-util"; import { GitHubApiDetails } from "./api-client"; import { CodeQL, setupCodeQL } from "./codeql"; import * as configUtils from "./config-utils"; +import { EnvVar } from "./environment"; import { CodeQLDefaultVersionInfo, Feature, FeatureEnablement, } from "./feature-flags"; +import { + RepositoryProperties, + RepositoryPropertyName, +} from "./feature-flags/properties"; import { KnownLanguage, Language } from "./languages"; import { Logger, withGroupAsync } from "./logging"; -import { RepositoryNwo } from "./repository"; import { ToolsSource } from "./setup-codeql"; import { ZstdAvailability } from "./tar"; import { ToolsDownloadStatusReport } from "./tools-download"; @@ -300,18 +307,112 @@ export function cleanupDatabaseClusterDirectory( export async function getFileCoverageInformationEnabled( debugMode: boolean, - repositoryNwo: RepositoryNwo, + codeql: CodeQL, features: FeatureEnablement, -): Promise { - return ( - // Always enable file coverage information in debug mode - debugMode || - // We're most interested in speeding up PRs, and we want to keep - // submitting file coverage information for the default branch since - // it is used to populate the status page. - !isAnalyzingPullRequest() || - // For now, restrict this feature to the GitHub org - repositoryNwo.owner !== "github" || - !(await features.getValue(Feature.SkipFileCoverageOnPrs)) - ); + repositoryProperties: RepositoryProperties, +): Promise<{ + enabled: boolean; + enabledByRepositoryProperty: boolean; + showDeprecationWarning: boolean; +}> { + // Always enable file coverage information in debug mode + if (debugMode) { + return { + enabled: true, + enabledByRepositoryProperty: false, + showDeprecationWarning: false, + }; + } + // We're most interested in speeding up PRs, and we want to keep + // submitting file coverage information for the default branch since + // it is used to populate the status page. + if (!isAnalyzingPullRequest()) { + return { + enabled: true, + enabledByRepositoryProperty: false, + showDeprecationWarning: false, + }; + } + // If the user has explicitly opted out via an environment variable, don't + // show the deprecation warning. + if ( + (process.env[EnvVar.FILE_COVERAGE_ON_PRS] || "").toLocaleLowerCase() === + "true" + ) { + return { + enabled: true, + enabledByRepositoryProperty: false, + showDeprecationWarning: false, + }; + } + // Allow repositories to opt in to file coverage information on PRs + // using a repository property. In this case, don't show the deprecation + // warning since the repository has explicitly opted in. + if ( + repositoryProperties[RepositoryPropertyName.FILE_COVERAGE_ON_PRS] === true + ) { + return { + enabled: true, + enabledByRepositoryProperty: true, + showDeprecationWarning: false, + }; + } + // If the feature is disabled, then maintain the previous behavior of + // unconditionally computing file coverage information, but warn that + // file coverage on PRs will be disabled in a future release. + if (!(await features.getValue(Feature.SkipFileCoverageOnPrs, codeql))) { + return { + enabled: true, + enabledByRepositoryProperty: false, + showDeprecationWarning: true, + }; + } + // Otherwise, disable file coverage information on PRs to speed up analysis. + return { + enabled: false, + enabledByRepositoryProperty: false, + showDeprecationWarning: false, + }; +} + +/** + * Log a warning about the deprecation of file coverage information on PRs, including how to opt + * back in via an environment variable or repository property. + */ +export function logFileCoverageOnPrsDeprecationWarning(logger: Logger): void { + if (process.env[EnvVar.DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION]) { + return; + } + + const repositoryOwnerType: string | undefined = + github.context.payload.repository?.owner.type; + + let message = + "Starting April 2026, the CodeQL Action will skip computing file coverage information on pull requests " + + "to improve analysis performance. File coverage information will still be computed on non-PR analyses."; + const envVarOptOut = + "set the `CODEQL_ACTION_FILE_COVERAGE_ON_PRS` environment variable to `true`."; + const repoPropertyOptOut = + "create a custom repository property with the name " + + '`github-codeql-file-coverage-on-prs` and the type "True/false", then set this property to ' + + "`true` in the repository's settings."; + + if (repositoryOwnerType === "Organization") { + // Org-owned repo: can use the repository property + if (isDefaultSetup()) { + message += `\n\nTo opt out of this change, ${repoPropertyOptOut}`; + } else { + message += `\n\nTo opt out of this change, ${envVarOptOut} Alternatively, ${repoPropertyOptOut}`; + } + } else if (isDefaultSetup()) { + // User-owned repo on default setup: no repo property available and + // no way to set env vars, so need to switch to advanced setup. + message += `\n\nTo opt out of this change, switch to an advanced setup workflow and ${envVarOptOut}`; + } else { + // User-owned repo on advanced setup: can set the env var + message += `\n\nTo opt out of this change, ${envVarOptOut}`; + } + + logger.warning(message); + core.exportVariable(EnvVar.DID_LOG_FILE_COVERAGE_ON_PRS_DEPRECATION, "true"); } diff --git a/src/json/index.ts b/src/json/index.ts new file mode 100644 index 0000000000..f3d212ebe7 --- /dev/null +++ b/src/json/index.ts @@ -0,0 +1,38 @@ +/** + * Represents a value we have obtained from parsing JSON which we know is an object, + * and expect to be of some type `T` which has not yet been validated. + */ +export type UnvalidatedObject = { [P in keyof T]?: unknown }; + +/** Represents a value we have obtained from parsing JSON which we know is an array. */ +export type UnvalidatedArray = unknown[]; + +/** + * Attempts to parse `data` as JSON. This function does not perform any validation and will therefore + * return a value of an `unknown` type if successful. Throws if `data` is not valid JSON. + */ +export function parseString(data: string): unknown { + return JSON.parse(data) as unknown; +} + +/** Asserts that `value` is an object, which is not yet validated, but expected to be of type `T`. */ +export function isObject(value: unknown): value is UnvalidatedObject { + return typeof value === "object" && value !== null && !Array.isArray(value); +} + +/** Asserts that `value` is an array, which is not yet validated. */ +export function isArray(value: unknown): value is UnvalidatedArray { + return Array.isArray(value); +} + +/** Asserts that `value` is a string. */ +export function isString(value: unknown): value is string { + return typeof value === "string"; +} + +/** Asserts that `value` is either a string or undefined. */ +export function isStringOrUndefined( + value: unknown, +): value is string | undefined { + return value === undefined || isString(value); +} diff --git a/src/overlay/index.ts b/src/overlay/index.ts index 3dde65f56d..3b45a60d44 100644 --- a/src/overlay/index.ts +++ b/src/overlay/index.ts @@ -33,6 +33,15 @@ export enum OverlayDatabaseMode { export const CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.8"; +// Per-language minimum CLI versions for overlay analysis, based on release +// validation data. +export const CODEQL_OVERLAY_MINIMUM_VERSION_CSHARP = "2.24.1"; +export const CODEQL_OVERLAY_MINIMUM_VERSION_GO = "2.24.2"; +export const CODEQL_OVERLAY_MINIMUM_VERSION_JAVA = "2.23.8"; +export const CODEQL_OVERLAY_MINIMUM_VERSION_JAVASCRIPT = "2.23.9"; +export const CODEQL_OVERLAY_MINIMUM_VERSION_PYTHON = "2.23.9"; +export const CODEQL_OVERLAY_MINIMUM_VERSION_RUBY = "2.23.9"; + /** * The maximum (uncompressed) size of the overlay base database that we will * upload. By default, the Actions Cache has an overall capacity of 10 GB, and diff --git a/src/overlay/status.ts b/src/overlay/status.ts index a57835ed1b..3acf382965 100644 --- a/src/overlay/status.ts +++ b/src/overlay/status.ts @@ -19,6 +19,7 @@ import { getWorkflowRunID, } from "../actions-util"; import { type CodeQL } from "../codeql"; +import * as json from "../json"; import { Logger } from "../logging"; import { DiskUsage, @@ -149,8 +150,7 @@ export async function getOverlayStatus( const contents = await fs.promises.readFile(statusFile, "utf-8"); const parsed: unknown = JSON.parse(contents); if ( - typeof parsed !== "object" || - parsed === null || + !json.isObject(parsed) || typeof parsed["attemptedToBuildOverlayBaseDatabase"] !== "boolean" || typeof parsed["builtOverlayBaseDatabase"] !== "boolean" ) { diff --git a/src/start-proxy.test.ts b/src/start-proxy.test.ts index a4dd8d589a..755189c21d 100644 --- a/src/start-proxy.test.ts +++ b/src/start-proxy.test.ts @@ -124,125 +124,110 @@ const mixedCredentials = [ { type: "git_source", host: "github.com/github", token: "mno" }, ]; -test.serial( - "getCredentials prefers registriesCredentials over registrySecrets", - async (t) => { - const registryCredentials = Buffer.from( - JSON.stringify([ - { type: "npm_registry", host: "npm.pkg.github.com", token: "abc" }, - ]), - ).toString("base64"); - const registrySecrets = JSON.stringify([ - { type: "npm_registry", host: "registry.npmjs.org", token: "def" }, - ]); +test("getCredentials prefers registriesCredentials over registrySecrets", async (t) => { + const registryCredentials = Buffer.from( + JSON.stringify([ + { type: "npm_registry", host: "npm.pkg.github.com", token: "abc" }, + ]), + ).toString("base64"); + const registrySecrets = JSON.stringify([ + { type: "npm_registry", host: "registry.npmjs.org", token: "def" }, + ]); - const credentials = startProxyExports.getCredentials( - getRunnerLogger(true), - registrySecrets, - registryCredentials, - undefined, - ); - t.is(credentials.length, 1); - t.is(credentials[0].host, "npm.pkg.github.com"); - }, -); + const credentials = startProxyExports.getCredentials( + getRunnerLogger(true), + registrySecrets, + registryCredentials, + undefined, + ); + t.is(credentials.length, 1); + t.is(credentials[0].host, "npm.pkg.github.com"); +}); -test.serial( - "getCredentials throws an error when configurations are not an array", - async (t) => { - const registryCredentials = Buffer.from( - JSON.stringify({ type: "npm_registry", token: "abc" }), - ).toString("base64"); +test("getCredentials throws an error when configurations are not an array", async (t) => { + const registryCredentials = Buffer.from( + JSON.stringify({ type: "npm_registry", token: "abc" }), + ).toString("base64"); + t.throws( + () => + startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + registryCredentials, + undefined, + ), + { + message: + "Expected credentials data to be an array of configurations, but it is not.", + }, + ); +}); + +test("getCredentials throws error when credential is not an object", async (t) => { + const testCredentials = [["foo"], [null]].map(toEncodedJSON); + + for (const testCredential of testCredentials) { t.throws( () => startProxyExports.getCredentials( getRunnerLogger(true), undefined, - registryCredentials, + testCredential, undefined, ), { - message: - "Expected credentials data to be an array of configurations, but it is not.", + message: "Invalid credentials - must be an object", }, ); - }, -); + } +}); -test.serial( - "getCredentials throws error when credential is not an object", - async (t) => { - const testCredentials = [["foo"], [null]].map(toEncodedJSON); - - for (const testCredential of testCredentials) { - t.throws( - () => - startProxyExports.getCredentials( - getRunnerLogger(true), - undefined, - testCredential, - undefined, - ), - { - message: "Invalid credentials - must be an object", - }, - ); - } - }, -); +test("getCredentials throws error when credential is missing type", async (t) => { + const testCredentials = [[{ token: "abc", url: "https://localhost" }]].map( + toEncodedJSON, + ); -test.serial( - "getCredentials throws error when credential is missing type", - async (t) => { - const testCredentials = [[{ token: "abc", url: "https://localhost" }]].map( - toEncodedJSON, + for (const testCredential of testCredentials) { + t.throws( + () => + startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + testCredential, + undefined, + ), + { + message: "Invalid credentials - must have a type", + }, ); + } +}); - for (const testCredential of testCredentials) { - t.throws( - () => - startProxyExports.getCredentials( - getRunnerLogger(true), - undefined, - testCredential, - undefined, - ), - { - message: "Invalid credentials - must have a type", - }, - ); - } - }, -); +test("getCredentials throws error when credential missing host and url", async (t) => { + const testCredentials = [ + [{ type: "npm_registry", token: "abc" }], + [{ type: "npm_registry", token: "abc", host: null }], + [{ type: "npm_registry", token: "abc", url: null }], + ].map(toEncodedJSON); -test.serial( - "getCredentials throws error when credential missing host and url", - async (t) => { - const testCredentials = [ - [{ type: "npm_registry", token: "abc" }], - [{ type: "npm_registry", token: "abc", host: null }], - [{ type: "npm_registry", token: "abc", url: null }], - ].map(toEncodedJSON); - - for (const testCredential of testCredentials) { - t.throws( - () => - startProxyExports.getCredentials( - getRunnerLogger(true), - undefined, - testCredential, - undefined, - ), - { - message: "Invalid credentials - must specify host or url", - }, - ); - } - }, -); + for (const testCredential of testCredentials) { + t.throws( + () => + startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + testCredential, + undefined, + ), + { + message: "Invalid credentials - must specify host or url", + }, + ); + } +}); -test.serial("getCredentials filters by language when specified", async (t) => { +test("getCredentials filters by language when specified", async (t) => { const credentials = startProxyExports.getCredentials( getRunnerLogger(true), undefined, @@ -253,145 +238,270 @@ test.serial("getCredentials filters by language when specified", async (t) => { t.is(credentials[0].type, "maven_repository"); }); -test.serial( - "getCredentials returns all for a language when specified", - async (t) => { - const credentials = startProxyExports.getCredentials( - getRunnerLogger(true), - undefined, - toEncodedJSON(mixedCredentials), - KnownLanguage.go, - ); - t.is(credentials.length, 2); +test("getCredentials returns all for a language when specified", async (t) => { + const credentials = startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + toEncodedJSON(mixedCredentials), + KnownLanguage.go, + ); + t.is(credentials.length, 2); - const credentialsTypes = credentials.map((c) => c.type); - t.assert(credentialsTypes.includes("goproxy_server")); - t.assert(credentialsTypes.includes("git_source")); - }, -); + const credentialsTypes = credentials.map((c) => c.type); + t.assert(credentialsTypes.includes("goproxy_server")); + t.assert(credentialsTypes.includes("git_source")); +}); -test.serial( - "getCredentials returns all credentials when no language specified", - async (t) => { - const credentialsInput = toEncodedJSON(mixedCredentials); +test("getCredentials returns all credentials when no language specified", async (t) => { + const credentialsInput = toEncodedJSON(mixedCredentials); - const credentials = startProxyExports.getCredentials( - getRunnerLogger(true), - undefined, - credentialsInput, - undefined, - ); - t.is(credentials.length, mixedCredentials.length); - }, -); + const credentials = startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + credentialsInput, + undefined, + ); + t.is(credentials.length, mixedCredentials.length); +}); -test.serial( - "getCredentials throws an error when non-printable characters are used", - async (t) => { - const invalidCredentials = [ - { type: "nuget_feed", host: "1nuget.pkg.github.com", token: "abc\u0000" }, // Non-printable character in token - { type: "nuget_feed", host: "2nuget.pkg.github.com\u0001" }, // Non-printable character in host +test("getCredentials throws an error when non-printable characters are used", async (t) => { + const invalidCredentials: startProxyExports.RawCredential[] = [ + { type: "nuget_feed", host: "1nuget.pkg.github.com", token: "abc\u0000" }, // Non-printable character in token + { type: "nuget_feed", host: "2nuget.pkg.github.com\u0001" }, // Non-printable character in host + { + type: "nuget_feed", + host: "3nuget.pkg.github.com", + password: "ghi\u0002", + }, // Non-printable character in password + { + type: "nuget_feed", + host: "4nuget.pkg.github.com", + token: "ghi\x00", + }, // Non-printable character in token + ]; + + for (const invalidCredential of invalidCredentials) { + const credentialsInput = toEncodedJSON([invalidCredential]); + + t.throws( + () => + startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + credentialsInput, + undefined, + ), { - type: "nuget_feed", - host: "3nuget.pkg.github.com", - password: "ghi\u0002", - }, // Non-printable character in password + message: + "Invalid credentials - fields must contain only printable characters", + }, + ); + } +}); + +const validAzureCredential: startProxyExports.AzureConfig = { + tenant_id: "12345678-1234-1234-1234-123456789012", + client_id: "abcdef01-2345-6789-abcd-ef0123456789", +}; + +const validAwsCredential: startProxyExports.AWSConfig = { + aws_region: "us-east-1", + account_id: "123456789012", + role_name: "MY_ROLE", + domain: "MY_DOMAIN", + domain_owner: "987654321098", + audience: "custom-audience", +}; + +const validJFrogCredential: startProxyExports.JFrogConfig = { + jfrog_oidc_provider_name: "MY_PROVIDER", + audience: "jfrog-audience", + identity_mapping_name: "my-mapping", +}; + +test("getCredentials throws an error when non-printable characters are used for Azure OIDC", (t) => { + for (const key of Object.keys(validAzureCredential)) { + const invalidAzureCredential = { + ...validAzureCredential, + [key]: "123\x00", + }; + const invalidCredential: startProxyExports.RawCredential = { + type: "nuget_feed", + host: `${key}.nuget.pkg.github.com`, + ...invalidAzureCredential, + }; + const credentialsInput = toEncodedJSON([invalidCredential]); + + t.throws( + () => + startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + credentialsInput, + undefined, + ), { - type: "nuget_feed", - host: "4nuget.pkg.github.com", - password: "ghi\x00", - }, // Non-printable character in password - ]; + message: + "Invalid credentials - fields must contain only printable characters", + }, + ); + } +}); - for (const invalidCredential of invalidCredentials) { - const credentialsInput = Buffer.from( - JSON.stringify([invalidCredential]), - ).toString("base64"); - - t.throws( - () => - startProxyExports.getCredentials( - getRunnerLogger(true), - undefined, - credentialsInput, - undefined, - ), - { - message: - "Invalid credentials - fields must contain only printable characters", - }, - ); - } - }, -); +test("getCredentials throws an error when non-printable characters are used for AWS OIDC", (t) => { + for (const key of Object.keys(validAwsCredential)) { + const invalidAwsCredential = { + ...validAwsCredential, + [key]: "123\x00", + }; + const invalidCredential: startProxyExports.RawCredential = { + type: "nuget_feed", + host: `${key}.nuget.pkg.github.com`, + ...invalidAwsCredential, + }; + const credentialsInput = toEncodedJSON([invalidCredential]); -test.serial( - "getCredentials logs a warning when a PAT is used without a username", - async (t) => { - const loggedMessages = []; - const logger = getRecordingLogger(loggedMessages); - const likelyWrongCredentials = toEncodedJSON([ + t.throws( + () => + startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + credentialsInput, + undefined, + ), { - type: "git_server", - host: "https://github.com/", - password: `ghp_${makeTestToken()}`, + message: + "Invalid credentials - fields must contain only printable characters", }, - ]); + ); + } +}); - const results = startProxyExports.getCredentials( - logger, - undefined, - likelyWrongCredentials, - undefined, +test("getCredentials throws an error when non-printable characters are used for JFrog OIDC", (t) => { + for (const key of Object.keys(validJFrogCredential)) { + const invalidJFrogCredential = { + ...validJFrogCredential, + [key]: "123\x00", + }; + const invalidCredential: startProxyExports.RawCredential = { + type: "nuget_feed", + host: `${key}.nuget.pkg.github.com`, + ...invalidJFrogCredential, + }; + const credentialsInput = toEncodedJSON([invalidCredential]); + + t.throws( + () => + startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + credentialsInput, + undefined, + ), + { + message: + "Invalid credentials - fields must contain only printable characters", + }, ); + } +}); - // The configuration should be accepted, despite the likely problem. - t.assert(results); - t.is(results.length, 1); - t.is(results[0].type, "git_server"); - t.is(results[0].host, "https://github.com/"); - t.assert(results[0].password?.startsWith("ghp_")); +test("getCredentials accepts OIDC configurations", (t) => { + const oidcConfigurations = [ + { + type: "nuget_feed", + host: "azure.pkg.github.com", + ...validAzureCredential, + }, + { + type: "nuget_feed", + host: "aws.pkg.github.com", + ...validAwsCredential, + }, + { + type: "nuget_feed", + host: "jfrog.pkg.github.com", + ...validJFrogCredential, + }, + ]; - // A warning should have been logged. - checkExpectedLogMessages(t, loggedMessages, [ - "using a GitHub Personal Access Token (PAT), but no username was provided", - ]); - }, -); + const credentials = startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + toEncodedJSON(oidcConfigurations), + KnownLanguage.csharp, + ); + t.is(credentials.length, 3); -test.serial( - "getCredentials returns all credentials for Actions when using LANGUAGE_TO_REGISTRY_TYPE", - async (t) => { - const credentialsInput = toEncodedJSON(mixedCredentials); + t.assert(credentials.every((c) => c.type === "nuget_feed")); + t.assert(credentials.some((c) => startProxyExports.isAzureConfig(c))); + t.assert(credentials.some((c) => startProxyExports.isAWSConfig(c))); + t.assert(credentials.some((c) => startProxyExports.isJFrogConfig(c))); +}); - const credentials = startProxyExports.getCredentials( - getRunnerLogger(true), - undefined, - credentialsInput, - KnownLanguage.actions, - false, - ); - t.is(credentials.length, mixedCredentials.length); - }, -); +test("getCredentials logs a warning when a PAT is used without a username", async (t) => { + const loggedMessages = []; + const logger = getRecordingLogger(loggedMessages); + const likelyWrongCredentials = toEncodedJSON([ + { + type: "git_server", + host: "https://github.com/", + password: `ghp_${makeTestToken()}`, + }, + ]); + + const results = startProxyExports.getCredentials( + logger, + undefined, + likelyWrongCredentials, + undefined, + ); -test.serial( - "getCredentials returns no credentials for Actions when using NEW_LANGUAGE_TO_REGISTRY_TYPE", - async (t) => { - const credentialsInput = toEncodedJSON(mixedCredentials); + // The configuration should be accepted, despite the likely problem. + t.assert(results); + t.is(results.length, 1); + t.is(results[0].type, "git_server"); + t.is(results[0].host, "https://github.com/"); - const credentials = startProxyExports.getCredentials( - getRunnerLogger(true), - undefined, - credentialsInput, - KnownLanguage.actions, - true, - ); - t.deepEqual(credentials, []); - }, -); + if (startProxyExports.isUsernamePassword(results[0])) { + t.assert(results[0].password?.startsWith("ghp_")); + } else { + t.fail("Expected a `UsernamePassword`-based credential."); + } + + // A warning should have been logged. + checkExpectedLogMessages(t, loggedMessages, [ + "using a GitHub Personal Access Token (PAT), but no username was provided", + ]); +}); -test.serial("parseLanguage", async (t) => { +test("getCredentials returns all credentials for Actions when using LANGUAGE_TO_REGISTRY_TYPE", async (t) => { + const credentialsInput = toEncodedJSON(mixedCredentials); + + const credentials = startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + credentialsInput, + KnownLanguage.actions, + false, + ); + t.is(credentials.length, mixedCredentials.length); +}); + +test("getCredentials returns no credentials for Actions when using NEW_LANGUAGE_TO_REGISTRY_TYPE", async (t) => { + const credentialsInput = toEncodedJSON(mixedCredentials); + + const credentials = startProxyExports.getCredentials( + getRunnerLogger(true), + undefined, + credentialsInput, + KnownLanguage.actions, + true, + ); + t.deepEqual(credentials, []); +}); + +test("parseLanguage", async (t) => { // Exact matches t.deepEqual(parseLanguage("csharp"), KnownLanguage.csharp); t.deepEqual(parseLanguage("cpp"), KnownLanguage.cpp); @@ -524,40 +634,6 @@ test.serial("getDownloadUrl returns matching release asset", async (t) => { }); }); -test.serial("credentialToStr - hides passwords", (t) => { - const secret = "password123"; - const credential = { - type: "maven_credential", - password: secret, - url: "https://localhost", - }; - - const str = startProxyExports.credentialToStr(credential); - - t.false(str.includes(secret)); - t.is( - "Type: maven_credential; Host: undefined; Url: https://localhost Username: undefined; Password: true; Token: false", - str, - ); -}); - -test.serial("credentialToStr - hides tokens", (t) => { - const secret = "password123"; - const credential = { - type: "maven_credential", - token: secret, - url: "https://localhost", - }; - - const str = startProxyExports.credentialToStr(credential); - - t.false(str.includes(secret)); - t.is( - "Type: maven_credential; Host: undefined; Url: https://localhost Username: undefined; Password: false; Token: true", - str, - ); -}); - test.serial( "getSafeErrorMessage - returns actual message for `StartProxyError`", (t) => { diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 60d0afbc6c..32762eae33 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -17,13 +17,26 @@ import { Feature, FeatureEnablement, } from "./feature-flags"; +import * as json from "./json"; import { KnownLanguage } from "./languages"; import { Logger } from "./logging"; import { Address, - RawCredential, Registry, Credential, + AuthConfig, + isToken, + isAzureConfig, + Token, + UsernamePassword, + AzureConfig, + isAWSConfig, + AWSConfig, + isJFrogConfig, + JFrogConfig, + isUsernamePassword, + hasUsername, + RawCredential, } from "./start-proxy/types"; import { ActionName, @@ -255,13 +268,19 @@ const NEW_LANGUAGE_TO_REGISTRY_TYPE: Required = { * * @throws A `ConfigurationError` if the `Registry` value contains neither a `url` or `host` field. */ -function getRegistryAddress(registry: Partial): Address { - if (isDefined(registry.url)) { +function getRegistryAddress( + registry: json.UnvalidatedObject, +): Address { + if ( + isDefined(registry.url) && + json.isString(registry.url) && + json.isStringOrUndefined(registry.host) + ) { return { url: registry.url, host: registry.host, }; - } else if (isDefined(registry.host)) { + } else if (isDefined(registry.host) && json.isString(registry.host)) { return { url: undefined, host: registry.host, @@ -274,6 +293,75 @@ function getRegistryAddress(registry: Partial): Address { } } +/** Extracts an `AuthConfig` value from `config`. */ +export function getAuthConfig( + config: json.UnvalidatedObject, +): AuthConfig { + // Start by checking for the OIDC configurations, since they have required properties + // which we can use to identify them. + if (isAzureConfig(config)) { + return { + tenant_id: config.tenant_id, + client_id: config.client_id, + } satisfies AzureConfig; + } else if (isAWSConfig(config)) { + return { + aws_region: config.aws_region, + account_id: config.account_id, + role_name: config.role_name, + domain: config.domain, + domain_owner: config.domain_owner, + audience: config.audience, + } satisfies AWSConfig; + } else if (isJFrogConfig(config)) { + return { + jfrog_oidc_provider_name: config.jfrog_oidc_provider_name, + identity_mapping_name: config.identity_mapping_name, + audience: config.audience, + } satisfies JFrogConfig; + } else if (isToken(config)) { + // There are three scenarios for non-OIDC authentication based on the registry type: + // + // 1. `username`+`token` + // 2. A `token` that combines the username and actual token, separated by ':'. + // 3. `username`+`password` + // + // In all three cases, all fields are optional. If the `token` field is present, + // we accept the configuration as a `Token` typed configuration, with the `token` + // value and an optional `username`. Otherwise, we accept the configuration + // typed as `UsernamePassword` (in the `else` clause below) with optional + // username and password. I.e. a private registry type that uses 1. or 2., + // but has no `token` configured, will get accepted as `UsernamePassword` here. + + if (isDefined(config.token)) { + // Mask token to reduce chance of accidental leakage in logs, if we have one. + core.setSecret(config.token); + } + + return { username: config.username, token: config.token } satisfies Token; + } else { + let username: string | undefined = undefined; + let password: string | undefined = undefined; + + // Both "username" and "password" are optional. If we have reached this point, we need + // to validate which of them are present and that they have the correct type if so. + if ("password" in config && json.isString(config.password)) { + // Mask password to reduce chance of accidental leakage in logs, if we have one. + core.setSecret(config.password); + password = config.password; + } + if ("username" in config && json.isString(config.username)) { + username = config.username; + } + + // Return the `UsernamePassword` object. Both username and password may be undefined. + return { + username, + password, + } satisfies UsernamePassword; + } +} + // getCredentials returns registry credentials from action inputs. // It prefers `registries_credentials` over `registry_secrets`. // If neither is set, it returns an empty array. @@ -304,9 +392,9 @@ export function getCredentials( } // Parse and validate the credentials - let parsed: RawCredential[]; + let parsed: unknown; try { - parsed = JSON.parse(credentialsStr) as RawCredential[]; + parsed = json.parseString(credentialsStr); } catch { // Don't log the error since it might contain sensitive information. logger.error("Failed to parse the credentials data."); @@ -314,7 +402,7 @@ export function getCredentials( } // Check that the parsed data is indeed an array. - if (!Array.isArray(parsed)) { + if (!json.isArray(parsed)) { throw new ConfigurationError( "Expected credentials data to be an array of configurations, but it is not.", ); @@ -322,23 +410,17 @@ export function getCredentials( const out: Credential[] = []; for (const e of parsed) { - if (e === null || typeof e !== "object") { + if (e === null || !json.isObject(e)) { throw new ConfigurationError("Invalid credentials - must be an object"); } // The configuration must have a type. - if (!isDefined(e.type)) { + if (!isDefined(e.type) || !json.isString(e.type)) { throw new ConfigurationError("Invalid credentials - must have a type"); } // Mask credentials to reduce chance of accidental leakage in logs. - if (isDefined(e.password)) { - core.setSecret(e.password); - } - if (isDefined(e.token)) { - core.setSecret(e.token); - } - + const authConfig = getAuthConfig(e); const address = getRegistryAddress(e); // Filter credentials based on language if specified. `type` is the registry type. @@ -354,24 +436,25 @@ export function getCredentials( return str ? /^[\x20-\x7E]*$/.test(str) : true; }; - if ( - !isPrintable(e.type) || - !isPrintable(e.host) || - !isPrintable(e.url) || - !isPrintable(e.username) || - !isPrintable(e.password) || - !isPrintable(e.token) - ) { - throw new ConfigurationError( - "Invalid credentials - fields must contain only printable characters", - ); + // Ensure that all string fields only contain printable characters. + for (const key of Object.keys(e)) { + const val = e[key]; + if (typeof val === "string" && !isPrintable(val)) { + throw new ConfigurationError( + "Invalid credentials - fields must contain only printable characters", + ); + } } // If the password or token looks like a GitHub PAT, warn if no username is configured. if ( - !isDefined(e.username) && - ((isDefined(e.password) && isPAT(e.password)) || - (isDefined(e.token) && isPAT(e.token))) + ((!hasUsername(authConfig) || !isDefined(authConfig.username)) && + isUsernamePassword(authConfig) && + isDefined(authConfig.password) && + isPAT(authConfig.password)) || + (isToken(authConfig) && + isDefined(authConfig.token) && + isPAT(authConfig.token)) ) { logger.warning( `A ${e.type} private registry is configured for ${e.host || e.url} using a GitHub Personal Access Token (PAT), but no username was provided. ` + @@ -382,9 +465,7 @@ export function getCredentials( out.push({ type: e.type, - username: e.username, - password: e.password, - token: e.token, + ...authConfig, ...address, }); } @@ -498,17 +579,6 @@ export async function getDownloadUrl( }; } -/** - * Pretty-prints a `Credential` value to a string, but hides the actual password or token values. - * - * @param c The credential to convert to a string. - */ -export function credentialToStr(c: Credential): string { - return `Type: ${c.type}; Host: ${c.host}; Url: ${c.url} Username: ${ - c.username - }; Password: ${c.password !== undefined}; Token: ${c.token !== undefined}`; -} - /** * Attempts to download a file from `url` into the toolcache. * diff --git a/src/start-proxy/types.test.ts b/src/start-proxy/types.test.ts new file mode 100644 index 0000000000..ee20e74aa7 --- /dev/null +++ b/src/start-proxy/types.test.ts @@ -0,0 +1,136 @@ +import test from "ava"; + +import { setupTests } from "../testing-utils"; + +import * as types from "./types"; + +setupTests(test); + +const validAzureCredential: types.AzureConfig = { + tenant_id: "12345678-1234-1234-1234-123456789012", + client_id: "abcdef01-2345-6789-abcd-ef0123456789", +}; + +const validAwsCredential: types.AWSConfig = { + aws_region: "us-east-1", + account_id: "123456789012", + role_name: "MY_ROLE", + domain: "MY_DOMAIN", + domain_owner: "987654321098", + audience: "custom-audience", +}; + +const validJFrogCredential: types.JFrogConfig = { + jfrog_oidc_provider_name: "MY_PROVIDER", + audience: "jfrog-audience", + identity_mapping_name: "my-mapping", +}; + +test("credentialToStr - pretty-prints valid username+password configurations", (t) => { + const secret = "password123"; + const credential: types.Credential = { + type: "maven_credential", + username: "user", + password: secret, + url: "https://localhost", + }; + + const str = types.credentialToStr(credential); + + t.false(str.includes(secret)); + t.is( + "Type: maven_credential; Url: https://localhost; Username: user; Password: ***;", + str, + ); +}); + +test("credentialToStr - pretty-prints valid username+token configurations", (t) => { + const secret = "password123"; + const credential: types.Credential = { + type: "maven_credential", + username: "user", + token: secret, + url: "https://localhost", + }; + + const str = types.credentialToStr(credential); + + t.false(str.includes(secret)); + t.is( + "Type: maven_credential; Url: https://localhost; Username: user; Token: ***;", + str, + ); +}); + +test("credentialToStr - pretty-prints valid Azure OIDC configurations", (t) => { + const credential: types.Credential = { + type: "maven_credential", + url: "https://localhost", + ...validAzureCredential, + }; + + const str = types.credentialToStr(credential); + + t.is( + "Type: maven_credential; Url: https://localhost; Tenant: 12345678-1234-1234-1234-123456789012; Client: abcdef01-2345-6789-abcd-ef0123456789;", + str, + ); +}); + +test("credentialToStr - pretty-prints valid AWS OIDC configurations", (t) => { + const credential: types.Credential = { + type: "maven_credential", + url: "https://localhost", + ...validAwsCredential, + }; + + const str = types.credentialToStr(credential); + + t.is( + "Type: maven_credential; Url: https://localhost; AWS Region: us-east-1; AWS Account: 123456789012; AWS Role: MY_ROLE; AWS Domain: MY_DOMAIN; AWS Domain Owner: 987654321098; AWS Audience: custom-audience;", + str, + ); +}); + +test("credentialToStr - pretty-prints valid JFrog OIDC configurations", (t) => { + const credential: types.Credential = { + type: "maven_credential", + url: "https://localhost", + ...validJFrogCredential, + }; + + const str = types.credentialToStr(credential); + + t.is( + "Type: maven_credential; Url: https://localhost; JFrog Provider: MY_PROVIDER; JFrog Identity Mapping: my-mapping; JFrog Audience: jfrog-audience;", + str, + ); +}); + +test("credentialToStr - hides passwords", (t) => { + const secret = "password123"; + const credential = { + type: "maven_credential", + password: secret, + url: "https://localhost", + }; + + const str = types.credentialToStr(credential); + + t.false(str.includes(secret)); + t.is("Type: maven_credential; Url: https://localhost; Password: ***;", str); +}); + +test("credentialToStr - hides tokens", (t) => { + const secret = "password123"; + const credential = { + type: "maven_credential", + token: secret, + url: "https://localhost", + }; + + const str = types.credentialToStr(credential); + + t.false(str.includes(secret)); + t.is("Type: maven_credential; Url: https://localhost; Token: ***;", str); +}); diff --git a/src/start-proxy/types.ts b/src/start-proxy/types.ts index 3d28b98d4f..0d3bf86c5b 100644 --- a/src/start-proxy/types.ts +++ b/src/start-proxy/types.ts @@ -1,22 +1,211 @@ +import type { UnvalidatedObject } from "../json"; +import * as json from "../json"; +import { isDefined } from "../util"; + /** * After parsing configurations from JSON, we don't know whether all the keys we expect are * present or not. This type is used to represent such values, which we expect to be * `Credential` values, but haven't validated yet. */ -export type RawCredential = Partial; +export type RawCredential = UnvalidatedObject; -/** - * A package registry configuration includes identifying information as well as - * authentication credentials. - */ -export type Credential = { +/** Usernames may be present for both authentication with tokens or passwords. */ +export type Username = { /** The username needed to authenticate to the package registry, if any. */ username?: string; +}; + +/** Decides whether `config` has a username. */ +export function hasUsername(config: AuthConfig): config is Username { + return "username" in config; +} + +/** + * Fields expected for authentication based on a username and password. + * Both username and password are optional. + */ +export type UsernamePassword = { /** The password needed to authenticate to the package registry, if any. */ password?: string; +} & Username; + +/** Decides whether `config` is based on a username and password. */ +export function isUsernamePassword( + config: AuthConfig, +): config is UsernamePassword { + return hasUsername(config) && "password" in config; +} + +/** + * Fields expected for token-based authentication. + * Both username and token are optional. + */ +export type Token = { /** The token needed to authenticate to the package registry, if any. */ token?: string; -} & Registry; +} & Username; + +/** Decides whether `config` is token-based. */ +export function isToken( + config: UnvalidatedObject, +): config is Token { + // The "username" field is optional, but should be a string if present. + if ("username" in config && !json.isStringOrUndefined(config.username)) { + return false; + } + + // The "token" field is required, and must be a string or undefined. + return "token" in config && json.isStringOrUndefined(config.token); +} + +/** Configuration for Azure OIDC. */ +export type AzureConfig = { tenant_id: string; client_id: string }; + +/** Decides whether `config` is an Azure OIDC configuration. */ +export function isAzureConfig( + config: UnvalidatedObject, +): config is AzureConfig { + return ( + "tenant_id" in config && + "client_id" in config && + isDefined(config.tenant_id) && + isDefined(config.client_id) && + json.isString(config.tenant_id) && + json.isString(config.client_id) + ); +} + +/** Configuration for AWS OIDC. */ +export type AWSConfig = { + aws_region: string; + account_id: string; + role_name: string; + domain: string; + domain_owner: string; + audience?: string; +}; + +/** Decides whether `config` is an AWS OIDC configuration. */ +export function isAWSConfig( + config: UnvalidatedObject, +): config is AWSConfig { + // All of these properties are required. + const requiredProperties = [ + "aws_region", + "account_id", + "role_name", + "domain", + "domain_owner", + ]; + + for (const property of requiredProperties) { + if ( + !(property in config) || + !isDefined(config[property]) || + !json.isString(config[property]) + ) { + return false; + } + } + + // The "audience" field is optional, but should be a string if present. + if ("audience" in config && !json.isStringOrUndefined(config.audience)) { + return false; + } + + return true; +} + +/** Configuration for JFrog OIDC. */ +export type JFrogConfig = { + jfrog_oidc_provider_name: string; + audience?: string; + identity_mapping_name?: string; +}; + +/** Decides whether `config` is a JFrog OIDC configuration. */ +export function isJFrogConfig( + config: UnvalidatedObject, +): config is JFrogConfig { + // The "audience" and "identity_mapping_name" fields are optional, but should be strings if present. + if ("audience" in config && !json.isStringOrUndefined(config.audience)) { + return false; + } + if ( + "identity_mapping_name" in config && + !json.isStringOrUndefined(config.identity_mapping_name) + ) { + return false; + } + + return ( + "jfrog_oidc_provider_name" in config && + isDefined(config.jfrog_oidc_provider_name) && + json.isString(config.jfrog_oidc_provider_name) + ); +} + +/** Represents all supported OIDC configurations. */ +export type OIDC = AzureConfig | AWSConfig | JFrogConfig; + +/** All authentication-related fields. */ +export type AuthConfig = UsernamePassword | Token | OIDC; + +/** + * A package registry configuration includes identifying information as well as + * authentication credentials. + */ +export type Credential = AuthConfig & Registry; + +/** + * Pretty-prints a `Credential` value to a string, but hides the actual password or token values. + * + * @param credential The credential to convert to a string. + */ +export function credentialToStr(credential: Credential): string { + let result: string = `Type: ${credential.type};`; + + const appendIfDefined = (name: string, val: string | undefined) => { + if (isDefined(val)) { + result += ` ${name}: ${val};`; + } + }; + + appendIfDefined("Url", credential.url); + appendIfDefined("Host", credential.host); + + if (hasUsername(credential)) { + appendIfDefined("Username", credential.username); + } + + if ("password" in credential) { + appendIfDefined( + "Password", + isDefined(credential.password) ? "***" : undefined, + ); + } + if (isToken(credential)) { + appendIfDefined("Token", isDefined(credential.token) ? "***" : undefined); + } + + if (isAzureConfig(credential)) { + appendIfDefined("Tenant", credential.tenant_id); + appendIfDefined("Client", credential.client_id); + } else if (isAWSConfig(credential)) { + appendIfDefined("AWS Region", credential.aws_region); + appendIfDefined("AWS Account", credential.account_id); + appendIfDefined("AWS Role", credential.role_name); + appendIfDefined("AWS Domain", credential.domain); + appendIfDefined("AWS Domain Owner", credential.domain_owner); + appendIfDefined("AWS Audience", credential.audience); + } else if (isJFrogConfig(credential)) { + appendIfDefined("JFrog Provider", credential.jfrog_oidc_provider_name); + appendIfDefined("JFrog Identity Mapping", credential.identity_mapping_name); + appendIfDefined("JFrog Audience", credential.audience); + } + + return result; +} /** A package registry is identified by its type and address. */ export type Registry = { diff --git a/src/status-report.ts b/src/status-report.ts index cdb96356e4..7cda9c2346 100644 --- a/src/status-report.ts +++ b/src/status-report.ts @@ -356,7 +356,6 @@ export async function createStatusReportBase( statusReport.matrix_vars = matrix; } if ("RUNNER_ARCH" in process.env) { - // RUNNER_ARCH is available only in GHES 3.4 and later // Values other than X86, X64, ARM, or ARM64 are discarded server side statusReport.runner_arch = process.env["RUNNER_ARCH"]; } diff --git a/src/tools-features.ts b/src/tools-features.ts index f572264345..5eefbd2276 100644 --- a/src/tools-features.ts +++ b/src/tools-features.ts @@ -10,6 +10,7 @@ export enum ToolsFeature { ForceOverwrite = "forceOverwrite", IndirectTracingSupportsStaticBinaries = "indirectTracingSupportsStaticBinaries", PythonDefaultIsToNotExtractStdlib = "pythonDefaultIsToNotExtractStdlib", + SuppressesMissingFileBaselineWarning = "suppressesMissingFileBaselineWarning", } /** diff --git a/src/upload-lib.test.ts b/src/upload-lib.test.ts index 92dc2e7732..e1990a811b 100644 --- a/src/upload-lib.test.ts +++ b/src/upload-lib.test.ts @@ -631,57 +631,10 @@ test.serial( "shouldShowCombineSarifFilesDeprecationWarning when on dotcom", async (t) => { t.true( - await uploadLib.shouldShowCombineSarifFilesDeprecationWarning( - [createMockSarif("abc", "def"), createMockSarif("abc", "def")], - { - type: GitHubVariant.DOTCOM, - }, - ), - ); - }, -); - -test.serial( - "shouldShowCombineSarifFilesDeprecationWarning when on GHES 3.13", - async (t) => { - t.false( - await uploadLib.shouldShowCombineSarifFilesDeprecationWarning( - [createMockSarif("abc", "def"), createMockSarif("abc", "def")], - { - type: GitHubVariant.GHES, - version: "3.13.2", - }, - ), - ); - }, -); - -test.serial( - "shouldShowCombineSarifFilesDeprecationWarning when on GHES 3.14", - async (t) => { - t.true( - await uploadLib.shouldShowCombineSarifFilesDeprecationWarning( - [createMockSarif("abc", "def"), createMockSarif("abc", "def")], - { - type: GitHubVariant.GHES, - version: "3.14.0", - }, - ), - ); - }, -); - -test.serial( - "shouldShowCombineSarifFilesDeprecationWarning when on GHES 3.16 pre", - async (t) => { - t.true( - await uploadLib.shouldShowCombineSarifFilesDeprecationWarning( - [createMockSarif("abc", "def"), createMockSarif("abc", "def")], - { - type: GitHubVariant.GHES, - version: "3.16.0.pre1", - }, - ), + await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([ + createMockSarif("abc", "def"), + createMockSarif("abc", "def"), + ]), ); }, ); @@ -690,12 +643,9 @@ test.serial( "shouldShowCombineSarifFilesDeprecationWarning with only 1 run", async (t) => { t.false( - await uploadLib.shouldShowCombineSarifFilesDeprecationWarning( - [createMockSarif("abc", "def")], - { - type: GitHubVariant.DOTCOM, - }, - ), + await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([ + createMockSarif("abc", "def"), + ]), ); }, ); @@ -704,12 +654,10 @@ test.serial( "shouldShowCombineSarifFilesDeprecationWarning with distinct categories", async (t) => { t.false( - await uploadLib.shouldShowCombineSarifFilesDeprecationWarning( - [createMockSarif("abc", "def"), createMockSarif("def", "def")], - { - type: GitHubVariant.DOTCOM, - }, - ), + await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([ + createMockSarif("abc", "def"), + createMockSarif("def", "def"), + ]), ); }, ); @@ -718,12 +666,10 @@ test.serial( "shouldShowCombineSarifFilesDeprecationWarning with distinct tools", async (t) => { t.false( - await uploadLib.shouldShowCombineSarifFilesDeprecationWarning( - [createMockSarif("abc", "abc"), createMockSarif("abc", "def")], - { - type: GitHubVariant.DOTCOM, - }, - ), + await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([ + createMockSarif("abc", "abc"), + createMockSarif("abc", "def"), + ]), ); }, ); @@ -734,12 +680,10 @@ test.serial( process.env["CODEQL_MERGE_SARIF_DEPRECATION_WARNING"] = "true"; t.false( - await uploadLib.shouldShowCombineSarifFilesDeprecationWarning( - [createMockSarif("abc", "def"), createMockSarif("abc", "def")], - { - type: GitHubVariant.DOTCOM, - }, - ), + await uploadLib.shouldShowCombineSarifFilesDeprecationWarning([ + createMockSarif("abc", "def"), + createMockSarif("abc", "def"), + ]), ); }, ); @@ -759,18 +703,6 @@ test.serial("throwIfCombineSarifFilesDisabled when on dotcom", async (t) => { ); }); -test.serial("throwIfCombineSarifFilesDisabled when on GHES 3.13", async (t) => { - await t.notThrowsAsync( - uploadLib.throwIfCombineSarifFilesDisabled( - [createMockSarif("abc", "def"), createMockSarif("abc", "def")], - { - type: GitHubVariant.GHES, - version: "3.13.2", - }, - ), - ); -}); - test.serial("throwIfCombineSarifFilesDisabled when on GHES 3.14", async (t) => { await t.notThrowsAsync( uploadLib.throwIfCombineSarifFilesDisabled( diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 2498825337..101e7946fc 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -47,16 +47,7 @@ const GENERIC_404_MSG = // Checks whether the deprecation warning for combining SARIF files should be shown. export async function shouldShowCombineSarifFilesDeprecationWarning( sarifObjects: Array>, - githubVersion: GitHubVersion, ) { - // Do not show this warning on GHES versions before 3.14.0 - if ( - githubVersion.type === GitHubVariant.GHES && - satisfiesGHESVersion(githubVersion.version, "<3.14", true) - ) { - return false; - } - // Only give a deprecation warning when not all runs are unique and // we haven't already shown the warning. return ( @@ -131,12 +122,7 @@ async function combineSarifFilesUsingCLI( "Not all SARIF files were produced by CodeQL. Merging files in the action.", ); - if ( - await shouldShowCombineSarifFilesDeprecationWarning( - sarifObjects, - gitHubVersion, - ) - ) { + if (await shouldShowCombineSarifFilesDeprecationWarning(sarifObjects)) { logger.warning( `Uploading multiple SARIF runs with the same category is deprecated ${deprecationWarningMessage}. Please update your workflow to upload a single run per category. ${deprecationMoreInformationMessage}`, ); diff --git a/src/util.ts b/src/util.ts index 6db56e7220..e2331461bd 100644 --- a/src/util.ts +++ b/src/util.ts @@ -14,6 +14,7 @@ import type { CodeQL, VersionInfo } from "./codeql"; import type { Pack } from "./config/db-config"; import type { Config } from "./config-utils"; import { EnvVar } from "./environment"; +import * as json from "./json"; import { Language } from "./languages"; import { Logger } from "./logging"; @@ -603,19 +604,15 @@ export class HTTPError extends Error { export class ConfigurationError extends Error {} export function asHTTPError(arg: any): HTTPError | undefined { - if ( - typeof arg !== "object" || - arg === null || - typeof arg.message !== "string" - ) { + if (!json.isObject(arg) || !json.isString(arg.message)) { return undefined; } if (Number.isInteger(arg.status)) { - return new HTTPError(arg.message as string, arg.status as number); + return new HTTPError(arg.message, arg.status as number); } // See https://github.com/actions/toolkit/blob/acb230b99a46ed33a3f04a758cd68b47b9a82908/packages/tool-cache/src/tool-cache.ts#L19 if (Number.isInteger(arg.httpStatusCode)) { - return new HTTPError(arg.message as string, arg.httpStatusCode as number); + return new HTTPError(arg.message, arg.httpStatusCode as number); } return undefined; }