1
0
mirror of https://gitea.com/actions/cache.git synced 2026-01-21 06:44:29 +07:00

Fix save-always/post-if with an output

This commit is contained in:
Danny Gleckler
2024-02-08 20:07:45 -05:00
parent a2ed59d39b
commit f908277314
6 changed files with 65 additions and 16 deletions

View File

@@ -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 {

View File

@@ -12,6 +12,8 @@ import * as utils from "./utils/actionUtils";
export async function restoreImpl(
stateProvider: IStateProvider
): Promise<string | undefined> {
core.setOutput(Outputs.SaveAlways, core.getInput(Inputs.SaveAlways));
try {
if (!utils.isCacheFeatureAvailable()) {
core.setOutput(Outputs.CacheHit, "false");