GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Support requesting latest version from toolcache with `tools: toolcache` by mbg · Pull Request #3175 · github/codeql-action Conversation
|
|
https://github.com/github/codeql-action/actions/runs/18225669790/job/51896145459#step:6:28 is a run of the new PR check with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| - 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 }} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I have set continue-on-error: true here 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 if tools: toolcache, but perhaps we could post a comment on the PR if no CLI was found in the toolcache?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This PR introduces support for requesting the latest version from the toolcache using tools: toolcache. This feature allows users to leverage any CodeQL CLI version already cached in the runner's toolcache instead of downloading or using a specific version.
Key changes include:
"toolcache" option for the tools parameter that finds the latest available version in the toolcacheCopilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/setup-codeql.ts | Adds toolcache logic and getLatestToolcacheVersion function |
| src/setup-codeql.test.ts | Comprehensive test coverage for toolcache functionality |
| pr-checks/checks/bundle-from-toolcache.yml | New test configuration for toolcache functionality |
| init/action.yml | Documentation update for new toolcache option |
| .github/actions/prepare-test/action.yml | Support for toolcache in test preparation |
| lib/*.js | Generated JavaScript code (auto-generated, not reviewed per guidelines) |
| .github/workflows/__bundle-from-toolcache.yml | Generated workflow file (auto-generated, not reviewed per guidelines) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm not against having the ability to request tools from the toolcache for internal testing purposes for instance. However we need to make it very clear that this will cause alerts to open and close repeatedly while new runner images roll out (a period of about half a day or so every two weeks). For this reason, this is an option we're unlikely to want to recommend.
Do you have a particular use case in mind?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| - 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 }} |
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.