-
Notifications
You must be signed in to change notification settings - Fork 417
Support requesting latest version from toolcache with tools: toolcache
#3175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
297313d
Add `getLatestToolcacheVersion` with tests
mbg 425ef85
Support requesting CLI from toolcache with `tools: toolcache`
mbg 7d468c9
Accept `toolcache` as `version` value for `prepare-test`
mbg 13a3a68
Add basic PR check for `tools: toolcache`
mbg 4d0c164
Remove `toolcache` option description from `action.yml`
mbg 43ce7ef
Add `isDynamicWorkflow` function
mbg 1cc5eb6
Use `semver.compare` instead of `semver.lt`
mbg 726a341
Restrict when `tools: toolcache` can be used
mbg 0ba4970
Merge branch 'main' into mbg/setup/toolcache
mbg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: "Bundle: From toolcache" | ||
| description: "The CodeQL bundle should be cached within the toolcache" | ||
| versions: | ||
| - toolcache | ||
| steps: | ||
| - name: Install @actions/tool-cache | ||
| run: npm install @actions/tool-cache | ||
| - name: Check toolcache contains CodeQL | ||
| continue-on-error: true | ||
| uses: actions/github-script@v8 | ||
| with: | ||
| script: | | ||
| const toolcache = require('@actions/tool-cache'); | ||
| const allCodeqlVersions = toolcache.findAllVersions('CodeQL'); | ||
| if (allCodeqlVersions.length === 0) { | ||
| throw new Error(`CodeQL could not be found in the toolcache`); | ||
| } | ||
| - id: init | ||
| uses: ./../action/init | ||
| with: | ||
| languages: javascript | ||
| tools: ${{ steps.prepare-test.outputs.tools-url }} | ||
| - name: Check CodeQL is installed within the toolcache | ||
| uses: actions/github-script@v8 | ||
| 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'); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have set
continue-on-error: truehere since I didn't want to depend on the CLI always being available in the toolcache. In general, I am happy for this check to just exercise that the workflow generally works iftools: toolcache, but perhaps we could post a comment on the PR if no CLI was found in the toolcache?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can probably depend on CodeQL being available in the toolcache.