Skip to content

Commit 13a3a68

Browse files
committed
Add basic PR check for tools: toolcache
1 parent 7d468c9 commit 13a3a68

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed

.github/workflows/__bundle-from-toolcache.yml

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Bundle: From toolcache"
2+
description: "The CodeQL bundle should be cached within the toolcache"
3+
versions:
4+
- toolcache
5+
steps:
6+
- name: Install @actions/tool-cache
7+
run: npm install @actions/tool-cache
8+
- name: Check toolcache contains CodeQL
9+
continue-on-error: true
10+
uses: actions/github-script@v8
11+
with:
12+
script: |
13+
const toolcache = require('@actions/tool-cache');
14+
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
15+
if (allCodeqlVersions.length === 0) {
16+
throw new Error(`CodeQL could not be found in the toolcache`);
17+
}
18+
- id: init
19+
uses: ./../action/init
20+
with:
21+
languages: javascript
22+
tools: ${{ steps.prepare-test.outputs.tools-url }}
23+
- name: Check CodeQL is installed within the toolcache
24+
uses: actions/github-script@v8
25+
with:
26+
script: |
27+
const toolcache = require('@actions/tool-cache');
28+
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
29+
console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
30+
if (allCodeqlVersions.length === 0) {
31+
throw new Error('CodeQL not found in toolcache');
32+
}

0 commit comments

Comments
 (0)