mirror of
https://code.forgejo.org/actions/cache.git
synced 2024-11-27 22:49:17 +01:00
Adding wrapper class
This commit is contained in:
parent
5fe0b944ef
commit
7f45813c72
4 changed files with 61398 additions and 2 deletions
61374
dist/restore-only/index.js
vendored
Normal file
61374
dist/restore-only/index.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -5,7 +5,7 @@
|
|||
"description": "Cache dependencies and build outputs",
|
||||
"main": "dist/restore/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc && ncc build -o dist/restore src/restore.ts && ncc build -o dist/save src/save.ts",
|
||||
"build": "tsc && ncc build -o dist/restore src/restore.ts && ncc build -o dist/save src/save.ts && ncc build -o dist/restore-only src/restore-only.ts",
|
||||
"test": "tsc --noEmit && jest --coverage",
|
||||
"lint": "eslint **/*.ts --cache",
|
||||
"format": "prettier --write **/*.ts",
|
||||
|
|
|
@ -20,7 +20,7 @@ outputs:
|
|||
description: 'A boolean value to indicate an exact match was found for the primary key'
|
||||
runs:
|
||||
using: 'node16'
|
||||
main: '../dist/restore/index.js'
|
||||
main: '../dist/restore-only/index.js'
|
||||
branding:
|
||||
icon: 'archive'
|
||||
color: 'gray-dark'
|
22
src/restore-only.ts
Normal file
22
src/restore-only.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import * as core from "@actions/core";
|
||||
|
||||
import { Inputs } from "./constants";
|
||||
import run from "./restore";
|
||||
|
||||
async function runRestoreAction(): Promise<void> {
|
||||
if (core.getInput(Inputs.SaveOnAnyFailure) != "") {
|
||||
core.info(
|
||||
`Input ${Inputs.SaveOnAnyFailure} value is passed in the input, this input will be ignored as you are using restore-only action`
|
||||
);
|
||||
}
|
||||
if (core.getInput(Inputs.UploadChunkSize) != "") {
|
||||
core.info(
|
||||
`Input ${Inputs.UploadChunkSize} value is passed in the input, this input will be ignored as you are using restore-only action`
|
||||
);
|
||||
}
|
||||
await run();
|
||||
}
|
||||
|
||||
runRestoreAction();
|
||||
|
||||
export default runRestoreAction;
|
Loading…
Reference in a new issue