mirror of
				https://github.com/actions/cache.git
				synced 2025-10-31 20:08:36 +08:00 
			
		
		
		
	Merge pull request #9 from runs-on/fix/allow-to-keep-using-env-credentials
Allow to keep using env credentials
This commit is contained in:
		
						commit
						6f883febcb
					
				|  | @ -42,5 +42,6 @@ Be aware of S3 transfer costs if your runners are not in the same AWS region as | ||||||
| ## Special environment variables | ## Special environment variables | ||||||
| 
 | 
 | ||||||
| * `RUNS_ON_S3_BUCKET_CACHE`: if set, the action will use this bucket to store the cache. | * `RUNS_ON_S3_BUCKET_CACHE`: if set, the action will use this bucket to store the cache. | ||||||
|  | * `RUNS_ON_RUNNER_NAME`: if set to `""` and running from RunsOn, the action will not ignore AWS credentials from the environment, if any. | ||||||
| * `RUNS_ON_S3_FORCE_PATH_STYLE` or `AWS_S3_FORCE_PATH_STYLE`: if one of those environment variables equals the string `"true"`, then the S3 client will be configured to force the path style. | * `RUNS_ON_S3_FORCE_PATH_STYLE` or `AWS_S3_FORCE_PATH_STYLE`: if one of those environment variables equals the string `"true"`, then the S3 client will be configured to force the path style. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -93775,7 +93775,7 @@ const lib_storage_1 = __nccwpck_require__(3087); | ||||||
| const downloadUtils_1 = __nccwpck_require__(6968); | const downloadUtils_1 = __nccwpck_require__(6968); | ||||||
| // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | ||||||
| // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | ||||||
| if (process.env.RUNS_ON_RUNNER_NAME) { | if (process.env.RUNS_ON_RUNNER_NAME && process.env.RUNS_ON_RUNNER_NAME !== "") { | ||||||
|     delete process.env.AWS_ACCESS_KEY_ID; |     delete process.env.AWS_ACCESS_KEY_ID; | ||||||
|     delete process.env.AWS_SECRET_ACCESS_KEY; |     delete process.env.AWS_SECRET_ACCESS_KEY; | ||||||
|     delete process.env.AWS_SESSION_TOKEN; |     delete process.env.AWS_SESSION_TOKEN; | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -93775,7 +93775,7 @@ const lib_storage_1 = __nccwpck_require__(3087); | ||||||
| const downloadUtils_1 = __nccwpck_require__(6968); | const downloadUtils_1 = __nccwpck_require__(6968); | ||||||
| // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | ||||||
| // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | ||||||
| if (process.env.RUNS_ON_RUNNER_NAME) { | if (process.env.RUNS_ON_RUNNER_NAME && process.env.RUNS_ON_RUNNER_NAME !== "") { | ||||||
|     delete process.env.AWS_ACCESS_KEY_ID; |     delete process.env.AWS_ACCESS_KEY_ID; | ||||||
|     delete process.env.AWS_SECRET_ACCESS_KEY; |     delete process.env.AWS_SECRET_ACCESS_KEY; | ||||||
|     delete process.env.AWS_SESSION_TOKEN; |     delete process.env.AWS_SESSION_TOKEN; | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ export interface ArtifactCacheEntry { | ||||||
| 
 | 
 | ||||||
| // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | ||||||
| // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | ||||||
| if (process.env.RUNS_ON_RUNNER_NAME) { | if (process.env.RUNS_ON_RUNNER_NAME && process.env.RUNS_ON_RUNNER_NAME !== "") { | ||||||
|     delete process.env.AWS_ACCESS_KEY_ID; |     delete process.env.AWS_ACCESS_KEY_ID; | ||||||
|     delete process.env.AWS_SECRET_ACCESS_KEY; |     delete process.env.AWS_SECRET_ACCESS_KEY; | ||||||
|     delete process.env.AWS_SESSION_TOKEN; |     delete process.env.AWS_SESSION_TOKEN; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Cyril Rohr
						Cyril Rohr