diff --git a/action.yml b/action.yml index cf2eb95..fc1a952 100644 --- a/action.yml +++ b/action.yml @@ -16,10 +16,10 @@ inputs: required: true access-key-id: description: 'aws access key id' - required: true + required: false secret-access-key: description: 'aws secret access key' - required: true + required: false bucket: description: 'aws s3 bucket' required: true diff --git a/dist/restore/index.js b/dist/restore/index.js index fd7f903..cf4497c 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -43288,13 +43288,20 @@ const path = __importStar(__webpack_require__(5622)); const actionUtils_1 = __webpack_require__(443); class CacheService { constructor(accessKeyId, secretAccessKey, region, bucket) { - this._client = new aws_sdk_1.S3({ - region: region, - credentials: { - accessKeyId: accessKeyId, - secretAccessKey: secretAccessKey - } - }); + if (accessKeyId && secretAccessKey) { + this._client = new aws_sdk_1.S3({ + region: region, + credentials: { + accessKeyId: accessKeyId, + secretAccessKey: secretAccessKey + } + }); + } + else { + this._client = new aws_sdk_1.S3({ + region: region + }); + } this._bucket = bucket; } restoreCache(paths, primaryKey, restoreKeys) { diff --git a/dist/save/index.js b/dist/save/index.js index dc4feba..ca36b55 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -43288,13 +43288,20 @@ const path = __importStar(__webpack_require__(5622)); const actionUtils_1 = __webpack_require__(443); class CacheService { constructor(accessKeyId, secretAccessKey, region, bucket) { - this._client = new aws_sdk_1.S3({ - region: region, - credentials: { - accessKeyId: accessKeyId, - secretAccessKey: secretAccessKey - } - }); + if (accessKeyId && secretAccessKey) { + this._client = new aws_sdk_1.S3({ + region: region, + credentials: { + accessKeyId: accessKeyId, + secretAccessKey: secretAccessKey + } + }); + } + else { + this._client = new aws_sdk_1.S3({ + region: region + }); + } this._bucket = bucket; } restoreCache(paths, primaryKey, restoreKeys) { diff --git a/package.json b/package.json index a4994c3..f5dd60c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cache", - "version": "0.11.0", + "version": "0.12.0", "private": true, "description": "Cache dependencies and build outputs", "main": "dist/restore/index.js", diff --git a/src/cache.service.ts b/src/cache.service.ts index e2ccfe3..41b0580 100644 --- a/src/cache.service.ts +++ b/src/cache.service.ts @@ -24,13 +24,19 @@ export class CacheService { region: string, bucket: string ) { - this._client = new S3({ - region: region, - credentials: { - accessKeyId: accessKeyId, - secretAccessKey: secretAccessKey - } - }); + if (accessKeyId && secretAccessKey) { + this._client = new S3({ + region: region, + credentials: { + accessKeyId: accessKeyId, + secretAccessKey: secretAccessKey + } + }); + } else { + this._client = new S3({ + region: region + }); + } this._bucket = bucket; }