PR check: Ensure bundle added to toolcache
This commit is contained in:
parent
0b2048550c
commit
8c0517fff8
2 changed files with 32 additions and 0 deletions
16
.github/workflows/__extract-direct-to-toolcache.yml
generated
vendored
16
.github/workflows/__extract-direct-to-toolcache.yml
generated
vendored
|
|
@ -69,6 +69,22 @@ jobs:
|
||||||
with:
|
with:
|
||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
upload-database: false
|
upload-database: false
|
||||||
|
- name: Install @actions/tool-cache
|
||||||
|
run: npm install @actions/tool-cache
|
||||||
|
- name: Check CodeQL is installed within the toolcache
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const toolcache = require('@actions/tool-cache');
|
||||||
|
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
|
||||||
|
console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
|
||||||
|
if (allCodeqlVersions.length === 0) {
|
||||||
|
throw new Error('CodeQL not found in toolcache');
|
||||||
|
}
|
||||||
|
if (allCodeqlVersions.length > 1) {
|
||||||
|
throw new Error('Multiple CodeQL versions found in toolcache');
|
||||||
|
}
|
||||||
|
console.log(`CodeQL version: ${allCodeqlVersions[0]}`);
|
||||||
env:
|
env:
|
||||||
CODEQL_ACTION_EXTRACT_TOOLCACHE: true
|
CODEQL_ACTION_EXTRACT_TOOLCACHE: true
|
||||||
CODEQL_ACTION_ZSTD_BUNDLE: true
|
CODEQL_ACTION_ZSTD_BUNDLE: true
|
||||||
|
|
|
||||||
|
|
@ -26,3 +26,19 @@ steps:
|
||||||
with:
|
with:
|
||||||
output: ${{ runner.temp }}/results
|
output: ${{ runner.temp }}/results
|
||||||
upload-database: false
|
upload-database: false
|
||||||
|
- name: Install @actions/tool-cache
|
||||||
|
run: npm install @actions/tool-cache
|
||||||
|
- name: Check CodeQL is installed within the toolcache
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const toolcache = require('@actions/tool-cache');
|
||||||
|
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
|
||||||
|
console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
|
||||||
|
if (allCodeqlVersions.length === 0) {
|
||||||
|
throw new Error('CodeQL not found in toolcache');
|
||||||
|
}
|
||||||
|
if (allCodeqlVersions.length > 1) {
|
||||||
|
throw new Error('Multiple CodeQL versions found in toolcache');
|
||||||
|
}
|
||||||
|
console.log(`CodeQL version: ${allCodeqlVersions[0]}`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue