mirror of
https://github.com/actions/setup-java.git
synced 2025-03-13 09:37:03 +00:00
Allow users to specify a read-only cache
This can reduce workflow runtime for situations, such as PRs, where the build artifacts may be disposable and of little use to other workflow runs.
This commit is contained in:
parent
f0bb916062
commit
f58da94109
2 changed files with 3 additions and 1 deletions
|
@ -23,7 +23,8 @@ async function removePrivateKeyFromKeychain() {
|
|||
async function saveCache() {
|
||||
const jobStatus = isJobStatusSuccess();
|
||||
const cache = core.getInput(constants.INPUT_CACHE);
|
||||
return jobStatus && cache ? save(cache) : Promise.resolve();
|
||||
const readOnlyCache = core.getInput(constants.INPUT_CACHE_READ_ONLY)
|
||||
return jobStatus && cache && !readOnlyCache ? save(cache) : Promise.resolve();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,6 +17,7 @@ export const INPUT_DEFAULT_GPG_PRIVATE_KEY = undefined;
|
|||
export const INPUT_DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE';
|
||||
|
||||
export const INPUT_CACHE = 'cache';
|
||||
export const INPUT_CACHE_READ_ONLY = "cache-is-read-only";
|
||||
export const INPUT_JOB_STATUS = 'job-status';
|
||||
|
||||
export const STATE_GPG_PRIVATE_KEY_FINGERPRINT = 'gpg-private-key-fingerprint';
|
||||
|
|
Loading…
Add table
Reference in a new issue