mirror of
https://github.com/actions/cache.git
synced 2025-04-23 14:30:49 +00:00
removed region
This commit is contained in:
parent
2e9ce0166f
commit
efa512101d
8 changed files with 9 additions and 31 deletions
|
@ -11,9 +11,6 @@ inputs:
|
|||
restore-keys:
|
||||
description: 'An ordered list of keys to use for restoring the cache if no cache hit occurred for key'
|
||||
required: false
|
||||
region:
|
||||
description: 'aws region'
|
||||
required: true
|
||||
access-key-id:
|
||||
description: 'aws access key id'
|
||||
required: false
|
||||
|
|
10
dist/restore/index.js
vendored
10
dist/restore/index.js
vendored
|
@ -5430,7 +5430,6 @@ var Inputs;
|
|||
Inputs["Key"] = "key";
|
||||
Inputs["Path"] = "path";
|
||||
Inputs["RestoreKeys"] = "restore-keys";
|
||||
Inputs["Region"] = "region";
|
||||
Inputs["AccessKeyId"] = "access-key-id";
|
||||
Inputs["SecretAccessKey"] = "secret-access-key";
|
||||
Inputs["Bucket"] = "bucket";
|
||||
|
@ -37463,7 +37462,7 @@ function run() {
|
|||
required: true
|
||||
});
|
||||
try {
|
||||
const cache = new cache_service_1.CacheService(core.getInput(constants_1.Inputs.AccessKeyId), core.getInput(constants_1.Inputs.SecretAccessKey), core.getInput(constants_1.Inputs.Region), core.getInput(constants_1.Inputs.Bucket));
|
||||
const cache = new cache_service_1.CacheService(core.getInput(constants_1.Inputs.AccessKeyId), core.getInput(constants_1.Inputs.SecretAccessKey), core.getInput(constants_1.Inputs.Bucket));
|
||||
const cacheKey = yield cache.restoreCache(cachePaths, primaryKey, restoreKeys);
|
||||
if (!cacheKey) {
|
||||
core.info(`Cache not found for input keys: ${[
|
||||
|
@ -43287,10 +43286,9 @@ const fs_1 = __importDefault(__webpack_require__(5747));
|
|||
const path = __importStar(__webpack_require__(5622));
|
||||
const actionUtils_1 = __webpack_require__(443);
|
||||
class CacheService {
|
||||
constructor(accessKeyId, secretAccessKey, region, bucket) {
|
||||
constructor(accessKeyId, secretAccessKey, bucket) {
|
||||
if (accessKeyId && secretAccessKey) {
|
||||
this._client = new aws_sdk_1.S3({
|
||||
region: region,
|
||||
credentials: {
|
||||
accessKeyId: accessKeyId,
|
||||
secretAccessKey: secretAccessKey
|
||||
|
@ -43298,9 +43296,7 @@ class CacheService {
|
|||
});
|
||||
}
|
||||
else {
|
||||
this._client = new aws_sdk_1.S3({
|
||||
region: region
|
||||
});
|
||||
this._client = new aws_sdk_1.S3();
|
||||
}
|
||||
this._bucket = bucket;
|
||||
}
|
||||
|
|
10
dist/save/index.js
vendored
10
dist/save/index.js
vendored
|
@ -5430,7 +5430,6 @@ var Inputs;
|
|||
Inputs["Key"] = "key";
|
||||
Inputs["Path"] = "path";
|
||||
Inputs["RestoreKeys"] = "restore-keys";
|
||||
Inputs["Region"] = "region";
|
||||
Inputs["AccessKeyId"] = "access-key-id";
|
||||
Inputs["SecretAccessKey"] = "secret-access-key";
|
||||
Inputs["Bucket"] = "bucket";
|
||||
|
@ -25883,7 +25882,7 @@ function run() {
|
|||
required: true
|
||||
});
|
||||
try {
|
||||
const cache = new cache_service_1.CacheService(core.getInput(constants_1.Inputs.AccessKeyId), core.getInput(constants_1.Inputs.SecretAccessKey), core.getInput(constants_1.Inputs.Region), core.getInput(constants_1.Inputs.Bucket));
|
||||
const cache = new cache_service_1.CacheService(core.getInput(constants_1.Inputs.AccessKeyId), core.getInput(constants_1.Inputs.SecretAccessKey), core.getInput(constants_1.Inputs.Bucket));
|
||||
yield cache.saveCache(cachePaths, primaryKey);
|
||||
core.info(`Cache saved with key: ${primaryKey}`);
|
||||
}
|
||||
|
@ -43287,10 +43286,9 @@ const fs_1 = __importDefault(__webpack_require__(5747));
|
|||
const path = __importStar(__webpack_require__(5622));
|
||||
const actionUtils_1 = __webpack_require__(443);
|
||||
class CacheService {
|
||||
constructor(accessKeyId, secretAccessKey, region, bucket) {
|
||||
constructor(accessKeyId, secretAccessKey, bucket) {
|
||||
if (accessKeyId && secretAccessKey) {
|
||||
this._client = new aws_sdk_1.S3({
|
||||
region: region,
|
||||
credentials: {
|
||||
accessKeyId: accessKeyId,
|
||||
secretAccessKey: secretAccessKey
|
||||
|
@ -43298,9 +43296,7 @@ class CacheService {
|
|||
});
|
||||
}
|
||||
else {
|
||||
this._client = new aws_sdk_1.S3({
|
||||
region: region
|
||||
});
|
||||
this._client = new aws_sdk_1.S3();
|
||||
}
|
||||
this._bucket = bucket;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cache",
|
||||
"version": "0.12.0",
|
||||
"version": "0.13.0",
|
||||
"private": true,
|
||||
"description": "Cache dependencies and build outputs",
|
||||
"main": "dist/restore/index.js",
|
||||
|
|
|
@ -18,24 +18,16 @@ export class CacheService {
|
|||
private _client: S3;
|
||||
private _bucket: string;
|
||||
|
||||
constructor(
|
||||
accessKeyId: string,
|
||||
secretAccessKey: string,
|
||||
region: string,
|
||||
bucket: string
|
||||
) {
|
||||
constructor(accessKeyId: string, secretAccessKey: string, bucket: string) {
|
||||
if (accessKeyId && secretAccessKey) {
|
||||
this._client = new S3({
|
||||
region: region,
|
||||
credentials: {
|
||||
accessKeyId: accessKeyId,
|
||||
secretAccessKey: secretAccessKey
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this._client = new S3({
|
||||
region: region
|
||||
});
|
||||
this._client = new S3();
|
||||
}
|
||||
this._bucket = bucket;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ export enum Inputs {
|
|||
Key = "key",
|
||||
Path = "path",
|
||||
RestoreKeys = "restore-keys",
|
||||
Region = "region",
|
||||
AccessKeyId = "access-key-id",
|
||||
SecretAccessKey = "secret-access-key",
|
||||
Bucket = "bucket"
|
||||
|
|
|
@ -18,7 +18,6 @@ async function run(): Promise<void> {
|
|||
const cache: CacheService = new CacheService(
|
||||
core.getInput(Inputs.AccessKeyId),
|
||||
core.getInput(Inputs.SecretAccessKey),
|
||||
core.getInput(Inputs.Region),
|
||||
core.getInput(Inputs.Bucket)
|
||||
);
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ async function run(): Promise<void> {
|
|||
const cache: CacheService = new CacheService(
|
||||
core.getInput(Inputs.AccessKeyId),
|
||||
core.getInput(Inputs.SecretAccessKey),
|
||||
core.getInput(Inputs.Region),
|
||||
core.getInput(Inputs.Bucket)
|
||||
);
|
||||
await cache.saveCache(cachePaths, primaryKey);
|
||||
|
|
Loading…
Add table
Reference in a new issue