mirror of
https://github.com/actions/cache.git
synced 2025-03-31 10:26:35 +00:00
Clean up actionUtils.ts a little
This commit is contained in:
parent
9420979f7c
commit
e6e13d9c52
1 changed files with 10 additions and 11 deletions
|
@ -1,9 +1,8 @@
|
|||
import * as cache from "@actions/cache";
|
||||
import * as core from "@actions/core";
|
||||
import { S3ClientConfig } from "@aws-sdk/client-s3";
|
||||
|
||||
import { Inputs, Outputs, RefKey, State } from "../constants";
|
||||
|
||||
import {CommonPrefix, InputSerialization, S3ClientConfig} from "@aws-sdk/client-s3";
|
||||
import { Inputs, RefKey } from "../constants";
|
||||
|
||||
export function isGhes(): boolean {
|
||||
const ghUrl = new URL(
|
||||
|
@ -82,23 +81,23 @@ Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github
|
|||
}
|
||||
|
||||
export function getInputS3ClientConfig(): S3ClientConfig | undefined {
|
||||
const s3BucketName = core.getInput(Inputs.AWSS3Bucket)
|
||||
const s3BucketName = core.getInput(Inputs.AWSS3Bucket);
|
||||
if (!s3BucketName) {
|
||||
return undefined
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const s3config = {
|
||||
credentials: {
|
||||
accessKeyId: core.getInput(Inputs.AWSAccessKeyId),
|
||||
secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)
|
||||
accessKeyId: core.getInput(Inputs.AWSAccessKeyId),
|
||||
secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)
|
||||
},
|
||||
region: core.getInput(Inputs.AWSRegion),
|
||||
endpoint: core.getInput(Inputs.AWSEndpoint),
|
||||
bucketEndpoint: core.getBooleanInput(Inputs.AWSS3BucketEndpoint),
|
||||
forcePathStyle: core.getBooleanInput(Inputs.AWSS3ForcePathStyle),
|
||||
} as S3ClientConfig
|
||||
forcePathStyle: core.getBooleanInput(Inputs.AWSS3ForcePathStyle)
|
||||
} as S3ClientConfig;
|
||||
|
||||
core.debug('Enable S3 backend mode.')
|
||||
core.debug("Enable S3 backend mode.");
|
||||
|
||||
return s3config
|
||||
return s3config;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue