mirror of
https://github.com/actions/cache.git
synced 2025-06-18 23:02:57 -06:00
Support AWS S3 and compatible software
This commit is contained in:
parent
72d1e4fdff
commit
3922a6a550
10 changed files with 122536 additions and 26393 deletions
11
src/save.ts
11
src/save.ts
|
@ -11,13 +11,6 @@ process.on("uncaughtException", e => utils.logWarning(e.message));
|
|||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
if (utils.isGhes()) {
|
||||
utils.logWarning(
|
||||
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!utils.isValidEvent()) {
|
||||
utils.logWarning(
|
||||
`Event Validation Error: The event type ${
|
||||
|
@ -46,11 +39,13 @@ async function run(): Promise<void> {
|
|||
const cachePaths = utils.getInputAsArray(Inputs.Path, {
|
||||
required: true
|
||||
});
|
||||
const s3BucketName = core.getInput(Inputs.AWSS3Bucket);
|
||||
const s3config = utils.getInputS3ClientConfig();
|
||||
|
||||
try {
|
||||
await cache.saveCache(cachePaths, primaryKey, {
|
||||
uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
|
||||
});
|
||||
}, s3config, s3BucketName);
|
||||
core.info(`Cache saved with key: ${primaryKey}`);
|
||||
} catch (error) {
|
||||
if (error.name === cache.ValidationError.name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue