File tree Expand file tree Collapse file tree 2 files changed +24
-6
lines changed
Expand file tree Collapse file tree 2 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,18 @@ steps:
1717 const path = require('path');
1818 const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
1919 fs.rmdirSync(codeqlPath, { recursive: true });
20+ - name : Install @actions/tool-cache
21+ run : npm install @actions/tool-cache
22+ - name : Check toolcache does not contain CodeQL
23+ uses : actions/github-script@v7
24+ with :
25+ script : |
26+ const toolcache = require('@actions/tool-cache');
27+ const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
28+ if (allCodeqlVersions.length !== 0) {
29+ throw new Error(`CodeQL should not be found in the toolcache, but found ${allCodeqlVersions}`);
30+ }
31+ console.log('No versions of CodeQL found in the toolcache');
2032 - id : init
2133 uses : ./../action/init
2234 with :
2638 with :
2739 output : ${{ runner.temp }}/results
2840 upload-database : false
29- - name : Install @actions/tool-cache
30- run : npm install @actions/tool-cache
3141 - name : Check CodeQL is installed within the toolcache
3242 uses : actions/github-script@v7
3343 with :
4151 if (allCodeqlVersions.length > 1) {
4252 throw new Error('Multiple CodeQL versions found in toolcache');
4353 }
44- console.log(`CodeQL version: ${allCodeqlVersions[0]}`);
You can’t perform that action at this time.
0 commit comments