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