| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Expose the primary cache key computed by the caching logic as a new `cache-primary-key` action output, so workflows can compose the built-in setup-java cache key with actions/cache or actions/cache/restore across steps and dependent jobs. - src/cache.ts: set the `cache-primary-key` output in restore() - action.yml: declare the new output - README.md: document the new output - __tests__/cache.test.ts: assert the output is set - dist: rebuild Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
This PR adds a new action output, cache-primary-key, to expose the primary dependency cache key computed by actions/setup-java, enabling users to reuse the exact same key in later steps or dependent jobs (e.g., with actions/cache / actions/cache/restore).
Changes:
| File | Description |
|---|---|
| src/cache.ts | Sets the new cache-primary-key output during restore() after computing the primary key. |
| action.yml | Declares cache-primary-key as an action output with a description. |
| README.md | Documents the new output and its intended usage with actions/cache tooling. |
| tests/cache.test.ts | Adds an assertion that cache-primary-key is set during restore. |
| dist/setup/index.js | Rebuilt bundle reflecting the new output behavior in the main action. |
| dist/cleanup/index.js | Rebuilt bundle reflecting the updated cache module code included in the post action bundle. |
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Port the review feedback from the main-line PR (#1088) into the v5 backport: - src/cache.ts: use the STATE_CACHE_PRIMARY_KEY constant for the output name instead of a duplicated string literal - action.yml / README.md: clarify that the output is also empty when caching is skipped (e.g. the cache service is unavailable) - dist: rebuild Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
* feat: expose cache-primary-key output (#597) Backport of the cache-primary-key output to the v5 release line. Expose the primary cache key computed by the caching logic as a new `cache-primary-key` action output, so workflows can compose the built-in setup-java cache key with actions/cache or actions/cache/restore across steps and dependent jobs. - src/cache.ts: set the `cache-primary-key` output in restore() - action.yml: declare the new output - README.md: document the new output - __tests__/cache.test.ts: assert the output is set - dist: rebuild (CommonJS) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Apply PR #1088 review suggestions to v5 backport Port the review feedback from the main-line PR (#1088) into the v5 backport: - src/cache.ts: use the STATE_CACHE_PRIMARY_KEY constant for the output name instead of a duplicated string literal - action.yml / README.md: clarify that the output is also empty when caching is skipped (e.g. the cache service is unavailable) - dist: rebuild Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@copilot rebase with main, rebuild the project and push the updated dist folder to this PR |
Sorry, something went wrong.
Done in c9cdf7a. I fetched latest main and rebased the branch (it was already up to date), rebuilt the project with npm run build, and pushed the updated dist artifacts to this PR. |
Sorry, something went wrong.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
What
Exposes the primary cache key computed by the caching logic as a new cache-primary-key action output.
Closes #597.
Why
Today the action computes a primary cache key internally (setup-java-<os>-<arch>-<packageManager>-<hash>) but never surfaces it. Users who want to compose the built-in setup-java caching with actions/cache / actions/cache/restore — e.g. to force the same key across dependent jobs — have no way to reference it. This exposes it as an output, mirroring what actions/setup-node and actions/cache already do.
Changes
Notes
Testing