GeezerVison is showing github.com — Merge pull request #11085 from dbartol/dbartol/ql-for-ql-latest · github/codeql@be16890
File tree
Expand file treeCollapse file tree
Open diff view settings
actions/find-latest-bundle
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +26Lines changed: 26 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +name: Find Latest CodeQL Bundle |
| 2 | +description: Finds the URL of the latest released version of the CodeQL bundle. |
| 3 | +outputs: |
| 4 | + url: |
| 5 | + description: The download URL of the latest CodeQL bundle release |
| 6 | + value: ${{ steps.find-latest.outputs.url }} |
| 7 | +runs: |
| 8 | + using: composite |
| 9 | + steps: |
| 10 | + - name: Find Latest Release |
| 11 | + id: find-latest |
| 12 | + shell: pwsh |
| 13 | + run: | |
| 14 | + $Latest = gh release list --repo github/codeql-action --exclude-drafts --limit 1000 | |
| 15 | + ForEach-Object { $C = $_ -split "`t"; return @{ type = $C[1]; tag = $C[2]; } } | |
| 16 | + Where-Object { $_.type -eq 'Latest' } |
| 17 | + |
| 18 | + $Tag = $Latest.tag |
| 19 | + if ($Tag -eq '') { |
| 20 | + throw 'Failed to find latest bundle release.' |
| 21 | + } |
| 22 | + |
| 23 | + Write-Output "Latest bundle tag is '${Tag}'." |
| 24 | + "url=https://github.com/github/codeql-action/releases/download/${Tag}/codeql-bundle-linux64.tar.gz" >> $env:GITHUB_OUTPUT |
| 25 | + env: |
| 26 | + GITHUB_TOKEN: ${{ github.token }} |
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/ql-for-ql-build.yml +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,11 +22,15 @@ jobs: |
22 | 22 | steps: |
23 | 23 | ### Build the queries ### |
24 | 24 | - uses: actions/checkout@v3 |
| 25 | + - name: Find latest bundle |
| 26 | + id: find-latest-bundle |
| 27 | + uses: ./.github/actions/find-latest-bundle |
25 | 28 | - name: Find codeql |
26 | 29 | id: find-codeql |
27 | 30 | uses: github/codeql-action/init@77a8d2d10c0b403a8b4aadbd223dc489ecd22683 |
28 | 31 | with: |
29 | 32 | languages: javascript # does not matter |
| 33 | + tools: ${{ steps.find-latest-bundle.outputs.url }} |
30 | 34 | - name: Get CodeQL version |
31 | 35 | id: get-codeql-version |
32 | 36 | run: | |
@@ -138,6 +142,7 @@ jobs: |
138 | 142 | languages: ql |
139 | 143 | db-location: ${{ runner.temp }}/db |
140 | 144 | config-file: ./ql-for-ql-config.yml |
| 145 | + tools: ${{ steps.find-latest-bundle.outputs.url }} |
141 | 146 | - name: Move pack cache |
142 | 147 | run: | |
143 | 148 | cp -r ${PACK}/.cache ql/ql/src/.cache |
|