12
0
Fork 0
mirror of https://github.com/actions/cache.git synced 2026-07-04 06:09:31 +00:00

Implemented

This commit is contained in:
Boris Staal 2023-04-09 10:24:49 -05:00
parent 88522ab9f3
commit f12187b90c
No known key found for this signature in database
29 changed files with 272142 additions and 230372 deletions

View file

@ -1,6 +1,7 @@
import * as cache from "@actions/cache";
import * as core from "@actions/core";
import { S3ClientConfig } from "@aws-sdk/client-s3";
import * as cache from "./backend";
import { Events, Inputs, State } from "./constants";
import { IStateProvider } from "./stateProvider";
import * as utils from "./utils/actionUtils";
@ -52,15 +53,22 @@ async function saveImpl(stateProvider: IStateProvider): Promise<number | void> {
required: true
});
const enableCrossOsArchive = utils.getInputAsBool(
Inputs.EnableCrossOsArchive
);
const s3Config = {
credentials: {
accessKeyId: core.getInput(Inputs.AwsAccessKeyId),
secretAccessKey: core.getInput(Inputs.AwsSecretAccessKey)
},
region: core.getInput(Inputs.AwsRegion)
} as S3ClientConfig;
const s3Bucket = core.getInput(Inputs.AwsBucket);
cacheId = await cache.saveCache(
cachePaths,
primaryKey,
{ uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize) },
enableCrossOsArchive
s3Config,
s3Bucket
);
if (cacheId != -1) {