mirror of
https://code.forgejo.org/actions/cache.git
synced 2024-11-24 04:29:16 +01:00
adding outputs
This commit is contained in:
parent
66ef8a0951
commit
a5fbe79711
6 changed files with 19 additions and 2 deletions
2
dist/restore/index.js
vendored
2
dist/restore/index.js
vendored
|
@ -47582,6 +47582,8 @@ var Inputs;
|
||||||
var Outputs;
|
var Outputs;
|
||||||
(function (Outputs) {
|
(function (Outputs) {
|
||||||
Outputs["CacheHit"] = "cache-hit";
|
Outputs["CacheHit"] = "cache-hit";
|
||||||
|
Outputs["Key"] = "key";
|
||||||
|
Outputs["MatchedKey"] = "matched-key";
|
||||||
})(Outputs = exports.Outputs || (exports.Outputs = {}));
|
})(Outputs = exports.Outputs || (exports.Outputs = {}));
|
||||||
var State;
|
var State;
|
||||||
(function (State) {
|
(function (State) {
|
||||||
|
|
2
dist/save/index.js
vendored
2
dist/save/index.js
vendored
|
@ -4975,6 +4975,8 @@ var Inputs;
|
||||||
var Outputs;
|
var Outputs;
|
||||||
(function (Outputs) {
|
(function (Outputs) {
|
||||||
Outputs["CacheHit"] = "cache-hit";
|
Outputs["CacheHit"] = "cache-hit";
|
||||||
|
Outputs["Key"] = "key";
|
||||||
|
Outputs["MatchedKey"] = "matched-key";
|
||||||
})(Outputs = exports.Outputs || (exports.Outputs = {}));
|
})(Outputs = exports.Outputs || (exports.Outputs = {}));
|
||||||
var State;
|
var State;
|
||||||
(function (State) {
|
(function (State) {
|
||||||
|
|
|
@ -14,6 +14,12 @@ inputs:
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit:
|
cache-hit:
|
||||||
description: 'A boolean value to indicate an exact match was found for the primary key'
|
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:
|
runs:
|
||||||
using: 'node16'
|
using: 'node16'
|
||||||
main: '../dist/restore/index.js'
|
main: '../dist/restore/index.js'
|
||||||
|
|
|
@ -11,6 +11,9 @@ inputs:
|
||||||
upload-chunk-size:
|
upload-chunk-size:
|
||||||
description: 'The chunk size used to split up large files during upload, in bytes'
|
description: 'The chunk size used to split up large files during upload, in bytes'
|
||||||
required: false
|
required: false
|
||||||
|
matched-key:
|
||||||
|
description: 'Cache key restored from the restore action'
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node16'
|
||||||
main: '../dist/save/index.js'
|
main: '../dist/save/index.js'
|
||||||
|
|
|
@ -6,7 +6,9 @@ export enum Inputs {
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum Outputs {
|
export enum Outputs {
|
||||||
CacheHit = "cache-hit"
|
CacheHit = "cache-hit",
|
||||||
|
Key = "key",
|
||||||
|
MatchedKey = "matched-key"
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum State {
|
export enum State {
|
||||||
|
|
|
@ -5,7 +5,9 @@ import { Events, Inputs, Outputs, State } from "./constants";
|
||||||
import { IStateProvider } from "./stateProvider";
|
import { IStateProvider } from "./stateProvider";
|
||||||
import * as utils from "./utils/actionUtils";
|
import * as utils from "./utils/actionUtils";
|
||||||
|
|
||||||
async function restoreImpl(stateProvider: IStateProvider): Promise<string | undefined> {
|
async function restoreImpl(
|
||||||
|
stateProvider: IStateProvider
|
||||||
|
): Promise<string | undefined> {
|
||||||
try {
|
try {
|
||||||
if (!utils.isCacheFeatureAvailable()) {
|
if (!utils.isCacheFeatureAvailable()) {
|
||||||
utils.setCacheHitOutput(false);
|
utils.setCacheHitOutput(false);
|
||||||
|
|
Loading…
Reference in a new issue