mirror of
https://github.com/actions/cache.git
synced 2025-04-01 19:06: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 cache from "@actions/cache";
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
import { S3ClientConfig } from "@aws-sdk/client-s3";
|
||||||
|
|
||||||
import { Inputs, Outputs, RefKey, State } from "../constants";
|
import { Inputs, RefKey } from "../constants";
|
||||||
|
|
||||||
import {CommonPrefix, InputSerialization, S3ClientConfig} from "@aws-sdk/client-s3";
|
|
||||||
|
|
||||||
export function isGhes(): boolean {
|
export function isGhes(): boolean {
|
||||||
const ghUrl = new URL(
|
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 {
|
export function getInputS3ClientConfig(): S3ClientConfig | undefined {
|
||||||
const s3BucketName = core.getInput(Inputs.AWSS3Bucket)
|
const s3BucketName = core.getInput(Inputs.AWSS3Bucket);
|
||||||
if (!s3BucketName) {
|
if (!s3BucketName) {
|
||||||
return undefined
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const s3config = {
|
const s3config = {
|
||||||
credentials: {
|
credentials: {
|
||||||
accessKeyId: core.getInput(Inputs.AWSAccessKeyId),
|
accessKeyId: core.getInput(Inputs.AWSAccessKeyId),
|
||||||
secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)
|
secretAccessKey: core.getInput(Inputs.AWSSecretAccessKey)
|
||||||
},
|
},
|
||||||
region: core.getInput(Inputs.AWSRegion),
|
region: core.getInput(Inputs.AWSRegion),
|
||||||
endpoint: core.getInput(Inputs.AWSEndpoint),
|
endpoint: core.getInput(Inputs.AWSEndpoint),
|
||||||
bucketEndpoint: core.getBooleanInput(Inputs.AWSS3BucketEndpoint),
|
bucketEndpoint: core.getBooleanInput(Inputs.AWSS3BucketEndpoint),
|
||||||
forcePathStyle: core.getBooleanInput(Inputs.AWSS3ForcePathStyle),
|
forcePathStyle: core.getBooleanInput(Inputs.AWSS3ForcePathStyle)
|
||||||
} as S3ClientConfig
|
} 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