mirror of
				https://code.forgejo.org/actions/cache.git
				synced 2025-11-04 06:19:11 +00:00 
			
		
		
		
	allow env vars
This commit is contained in:
		
							parent
							
								
									a0cd727d86
								
							
						
					
					
						commit
						d150281810
					
				
					 2 changed files with 6 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -19,10 +19,10 @@ inputs:
 | 
			
		|||
    required: true
 | 
			
		||||
  aws-access-key-id:
 | 
			
		||||
    description: 'An AWS access key id to access the bucket'
 | 
			
		||||
    required: true
 | 
			
		||||
    required: false
 | 
			
		||||
  aws-secret-access-key:
 | 
			
		||||
    description: 'An AWS secret access key to access the bucket'
 | 
			
		||||
    required: true
 | 
			
		||||
    required: false
 | 
			
		||||
  aws-region:
 | 
			
		||||
    description: 'An AWS region where the bucket is located'
 | 
			
		||||
    required: false
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@ import * as core from "@actions/core";
 | 
			
		|||
 | 
			
		||||
import { Inputs, Outputs, RefKey, State } from "../constants";
 | 
			
		||||
 | 
			
		||||
import {CommonPrefix, InputSerialization, S3ClientConfig} from "@aws-sdk/client-s3";
 | 
			
		||||
import {S3ClientConfig} from "@aws-sdk/client-s3";
 | 
			
		||||
 | 
			
		||||
export function isGhes(): boolean {
 | 
			
		||||
    const ghUrl = new URL(
 | 
			
		||||
| 
						 | 
				
			
			@ -85,10 +85,10 @@ export function getInputS3ClientConfig(): S3ClientConfig | undefined {
 | 
			
		|||
 | 
			
		||||
    const s3config = {
 | 
			
		||||
        credentials: {
 | 
			
		||||
          accessKeyId: core.getInput(Inputs.AWSAccessKeyId),
 | 
			
		||||
          secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)
 | 
			
		||||
          accessKeyId: core.getInput(Inputs.AWSAccessKeyId) || process.env['AWS_ACCESS_KEY_ID'],
 | 
			
		||||
          secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)|| process.env['AWS_SECRET_ACCESS_KEY']
 | 
			
		||||
        },
 | 
			
		||||
        region: core.getInput(Inputs.AWSRegion),
 | 
			
		||||
        region: core.getInput(Inputs.AWSRegion) || process.env['AWS_REGION'],
 | 
			
		||||
        endpoint: core.getInput(Inputs.AWSEndpoint),
 | 
			
		||||
        bucketEndpoint: core.getBooleanInput(Inputs.AWSS3BucketEndpoint),
 | 
			
		||||
        forcePathStyle: core.getBooleanInput(Inputs.AWSS3ForcePathStyle),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue