feat: Implement ability to disable adding job ID + rust environment hashes to cache names#279
Merged
Swatinem merged 18 commits intoSwatinem:masterfrom Nov 3, 2025
Merged
Conversation
Add option to include GITHUB_JOB in cache key.
Fix typo in 'use-job-key' description and required field.
Replace direct use of 'useJobKey' property with input retrieval for flexibility.
Correct description and requirement for 'use-job-key'.
- Added CacheConfig class to manage cache paths, keys, and workspace configurations. - Implemented cache restoration logic in restore.js, including handling cache misses and mismatches. - Developed save.js to handle cache saving, including cleaning up target directories and registry. - Introduced utility functions in utils.js for command execution and cache provider selection. - Created Workspace class in workspace.js to manage Rust workspace metadata and package retrieval.
…for their intended functionality
…action.yml` files `runs.using` version `"node20"` NOTE: Updating to stop `tsc` command warnings when using `typescript@5.9.3`
…duced key option logic
Swatinem
reviewed
Nov 1, 2025
…s in tsconfig.json + rebuilt index.js files
…keyFiles definition to avoid un-needed computation
Swatinem
approved these changes
Nov 3, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduce two new config options to control how cache keys are generated. These options allow users to enable or disable the inclusion of the job ID and/or hash of the Rust environment in the cache key, providing more flexibility for caching strategies.
Changes
New cache key configuration options
add-job-id-keyandadd-rust-environment-hash-key, both defaulting to"true".src/config.tsto work with newly added action inputs.Related issues
Documentation updates
README.mdto document the new options, their defaults, and how they affect cache key generation.Workflow example
.github/workflows/multi-job-cache.yml.Related issues