GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support requesting latest version from toolcache with `tools: toolcache` by mbg · Pull Request #3175 · github/codeql-action

Conversation

@mbg

@mbg mbg commented Oct 3, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Allows toolcache as a possible input for tools. Useful if you don't necessarily care about the a specific version of CodeQL and care more about having it readily available on the runner.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change.
  • Confirm the readme and docs have been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mbg added 4 commits October 3, 2025 14:40
@mbg
Add getLatestToolcacheVersion with tests
297313d
@mbg
Support requesting CLI from toolcache with tools: toolcache
425ef85
@mbg
Accept toolcache as version value for prepare-test
7d468c9
@mbg
Add basic PR check for tools: toolcache
13a3a68
@mbg

mbg commented Oct 3, 2025

Copy link
Copy Markdown
Member Author

https://github.com/github/codeql-action/actions/runs/18225669790/job/51896145459#step:6:28 is a run of the new PR check with tools: toolcache working as expected.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mbg
mbg commented Oct 3, 2025
View reviewed changes
Comment thread pr-checks/checks/bundle-from-toolcache.yml
Comment on lines +8 to +22
- 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 }}

@mbg mbg Oct 3, 2025

Copy link
Copy Markdown
Member Author

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: 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@henrymercer henrymercer Oct 7, 2025

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
mbg marked this pull request as ready for review October 3, 2025 15:33
@mbg
mbg requested a review from a team as a code owner October 3, 2025 15:33
@mbg
mbg requested review from Copilot and henrymercer October 3, 2025 15:34
Copilot AI reviewed Oct 3, 2025
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

Pull Request Overview

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:

  • Adds a new "toolcache" option for the tools parameter that finds the latest available version in the toolcache
  • Implements fallback behavior to download the default version if no CodeQL CLI is found in the toolcache
  • Updates documentation and test configuration to support the new option

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/setup-codeql.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

henrymercer
henrymercer requested changes Oct 3, 2025
View reviewed changes

@henrymercer henrymercer left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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'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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
mbg added 4 commits October 6, 2025 12:53
@mbg
Remove toolcache option description from action.yml
4d0c164
@mbg
Add isDynamicWorkflow function
43ce7ef
@mbg
Use semver.compare instead of semver.lt
1cc5eb6
@mbg
Restrict when tools: toolcache can be used
726a341
@mbg
mbg requested a review from henrymercer October 6, 2025 12:23
henrymercer
henrymercer approved these changes Oct 7, 2025
View reviewed changes
Comment thread pr-checks/checks/bundle-from-toolcache.yml
Comment on lines +8 to +22
- 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 }}

@henrymercer henrymercer Oct 7, 2025

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mbg
Merge branch 'main' into mbg/setup/toolcache
0ba4970
@mbg
mbg enabled auto-merge October 7, 2025 09:09
@mbg
mbg merged commit 2f11c17 into main Oct 7, 2025
@mbg
mbg deleted the mbg/setup/toolcache branch October 7, 2025 09:32
@mbg mbg mentioned this pull request Oct 10, 2025
Gate tools: toolcache behind FF #3193
Merged
This was referenced Oct 10, 2025
Merge main into releases/v4 #3198
Merged
Merge releases/v4 into releases/v3 #3201
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@henrymercer henrymercer henrymercer approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mbg @henrymercer
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.