1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-10-17 06:34:41 +02:00

Clean up actionUtils.ts a little

This commit is contained in:
Dan Blanchard 2023-08-31 14:14:17 -04:00
parent 9420979f7c
commit e6e13d9c52
No known key found for this signature in database

View file

@ -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,9 +81,9 @@ 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 = {
@ -95,10 +94,10 @@ export function getInputS3ClientConfig(): S3ClientConfig | undefined {
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;
}