Adding wrapper class

This commit is contained in:
Sankalp Kotewar 2022-11-29 08:02:27 +00:00 committed by GitHub
parent 5fe0b944ef
commit 7f45813c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61398 additions and 2 deletions

61374
dist/restore-only/index.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -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",

View File

@ -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
View 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;