mirror of
https://github.com/actions/cache.git
synced 2026-06-08 16:50:28 +08:00
Fix save-always/post-if with an output
This commit is contained in:
@@ -5,13 +5,15 @@ export enum Inputs {
|
||||
UploadChunkSize = "upload-chunk-size", // Input for cache, save action
|
||||
EnableCrossOsArchive = "enableCrossOsArchive", // Input for cache, restore, save action
|
||||
FailOnCacheMiss = "fail-on-cache-miss", // Input for cache, restore action
|
||||
LookupOnly = "lookup-only" // Input for cache, restore action
|
||||
LookupOnly = "lookup-only", // Input for cache, restore action
|
||||
SaveAlways = "save-always" // Input for cache action
|
||||
}
|
||||
|
||||
export enum Outputs {
|
||||
CacheHit = "cache-hit", // Output from cache, restore action
|
||||
CachePrimaryKey = "cache-primary-key", // Output from restore action
|
||||
CacheMatchedKey = "cache-matched-key" // Output from restore action
|
||||
CacheMatchedKey = "cache-matched-key", // Output from restore action
|
||||
SaveAlways = "save-always-d18d746b9" // Output from cache action, with unique suffix for detection in post-if
|
||||
}
|
||||
|
||||
export enum State {
|
||||
|
||||
@@ -13,6 +13,8 @@ export async function restoreImpl(
|
||||
stateProvider: IStateProvider,
|
||||
earlyExit?: boolean | undefined
|
||||
): Promise<string | undefined> {
|
||||
core.setOutput(Outputs.SaveAlways, core.getInput(Inputs.SaveAlways));
|
||||
|
||||
try {
|
||||
if (!utils.isCacheFeatureAvailable()) {
|
||||
core.setOutput(Outputs.CacheHit, "false");
|
||||
|
||||
Reference in New Issue
Block a user