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:
17
17
const path = require('path');
18
18
const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL');
19
19
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');
20
32
- id : init
21
33
uses : ./../action/init
22
34
with :
26
38
with :
27
39
output : ${{ runner.temp }}/results
28
40
upload-database : false
29
- - name : Install @actions/tool-cache
30
- run : npm install @actions/tool-cache
31
41
- name : Check CodeQL is installed within the toolcache
32
42
uses : actions/github-script@v7
33
43
with :
41
51
if (allCodeqlVersions.length > 1) {
42
52
throw new Error('Multiple CodeQL versions found in toolcache');
43
53
}
44
- console.log(`CodeQL version: ${allCodeqlVersions[0]}`);
You can’t perform that action at this time.
0 commit comments