From bb0b0801dde5fa69c12aac8c3d36094e7432552d Mon Sep 17 00:00:00 2001 From: Dave Bartolomeo Date: Wed, 2 Nov 2022 11:38:11 -0400 Subject: [PATCH] Try again --- .github/actions/find-latest-bundle/action.yml | 20 +++++++++++++++++++ .github/workflows/ql-for-ql-build.yml | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/actions/find-latest-bundle/action.yml diff --git a/.github/actions/find-latest-bundle/action.yml b/.github/actions/find-latest-bundle/action.yml new file mode 100644 index 00000000000..3f4e089d476 --- /dev/null +++ b/.github/actions/find-latest-bundle/action.yml @@ -0,0 +1,20 @@ +name: Find Latest CodeQL Bundle +description: Finds the URL of the latest released version of the CodeQL bundle. +outputs: + url: + description: The download URL of the latest CodeQL bundle release + value: ${{ steps.find-latest.outputs.url }} +runs: + using: composite + steps: + - name: Find Latest Release + id: find-latest + shell: pwsh + run: | + $Latest = gh release list --exclude-drafts --limit 1000 | + ForEach-Object { $C = $_ -split "`t"; return @{ type = $C[1]; tag = $C[2]; } } | + Where-Object { $_.type -eq 'Latest' } + + $Tag = $Latest.tag + Write-Output "Latest bundle tag is '${Tag}'." + "url=https://github.com/github/codeql-action/releases/download/${Tag}/codeql-bundle-linux64.tar.gz" >> $env:GITHUB_OUTPUT diff --git a/.github/workflows/ql-for-ql-build.yml b/.github/workflows/ql-for-ql-build.yml index e3cacf73d2e..0af98b21e09 100644 --- a/.github/workflows/ql-for-ql-build.yml +++ b/.github/workflows/ql-for-ql-build.yml @@ -22,12 +22,15 @@ jobs: steps: ### Build the queries ### - uses: actions/checkout@v3 + - name: Find latest bundle + id: find-latest-bundle + uses: ./.github/actions/find-latest-bundle - name: Find codeql id: find-codeql uses: github/codeql-action/init@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca with: languages: javascript # does not matter - tools: latest + tools: ${{ steps.find-latest-bundle.outputs.url }} - name: Get CodeQL version id: get-codeql-version run: |