adding outputs

This commit is contained in:
Tanuj Kumar Mishra 2022-12-07 17:07:30 +00:00
parent 66ef8a0951
commit a5fbe79711
6 changed files with 19 additions and 2 deletions

View File

@ -47582,6 +47582,8 @@ var Inputs;
var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["Key"] = "key";
Outputs["MatchedKey"] = "matched-key";
})(Outputs = exports.Outputs || (exports.Outputs = {}));
var State;
(function (State) {

2
dist/save/index.js vendored
View File

@ -4975,6 +4975,8 @@ var Inputs;
var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["Key"] = "key";
Outputs["MatchedKey"] = "matched-key";
})(Outputs = exports.Outputs || (exports.Outputs = {}));
var State;
(function (State) {

View File

@ -14,6 +14,12 @@ inputs:
outputs:
cache-hit:
description: 'A boolean value to indicate an exact match was found for the primary key'
key:
description: 'Key passed in the input to use in subsequent steps of the workflow'
required: true
matched-key:
description: 'Cache key restored'
required: true
runs:
using: 'node16'
main: '../dist/restore/index.js'

View File

@ -11,6 +11,9 @@ inputs:
upload-chunk-size:
description: 'The chunk size used to split up large files during upload, in bytes'
required: false
matched-key:
description: 'Cache key restored from the restore action'
required: false
runs:
using: 'node16'
main: '../dist/save/index.js'

View File

@ -6,7 +6,9 @@ export enum Inputs {
}
export enum Outputs {
CacheHit = "cache-hit"
CacheHit = "cache-hit",
Key = "key",
MatchedKey = "matched-key"
}
export enum State {

View File

@ -5,7 +5,9 @@ import { Events, Inputs, Outputs, State } from "./constants";
import { IStateProvider } from "./stateProvider";
import * as utils from "./utils/actionUtils";
async function restoreImpl(stateProvider: IStateProvider): Promise<string | undefined> {
async function restoreImpl(
stateProvider: IStateProvider
): Promise<string | undefined> {
try {
if (!utils.isCacheFeatureAvailable()) {
utils.setCacheHitOutput(false);