Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Archive UHK releases'
description: 'Upload specific files to AWS S3'
description: 'Upload specific files to S3-compatible object storage'
inputs:
FILE_PATTERN:
description: File pattern of the upload files
Expand All @@ -19,6 +19,8 @@ inputs:
S3_BUCKET:
description: S3 Bucket
required: true
S3_ENDPOINT:
description: Optional custom S3 endpoint (e.g. Backblaze B2 https://s3.<region>.backblazeb2.com)
S3_INDEX_FILE_KEY:
description: S3 Key of the json index file that store the extra meta data of each s3 object
S3_KEY_PREFIX:
Expand Down
3 changes: 3 additions & 0 deletions lib/utils/get-inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { TEST_GITHUB_REPOSITORY, TEST_GITHUB_SHA } from '../constants.js'
* @property {string} s3AccessKey
* @property {string} s3AccessKeyId
* @property {string} s3Bucket
* @property {string} [s3Endpoint]
* @property {string} s3IndexFileKey
* @property {string} s3KeyPrefix
* @property {string} s3Region
Expand All @@ -31,6 +32,7 @@ export function getInputs() {
s3AccessKey: process.env.S3_ACCESS_KEY,
s3AccessKeyId: process.env.S3_ACCESS_KEY_ID,
s3Bucket: process.env.S3_BUCKET,
s3Endpoint: process.env.S3_ENDPOINT,
s3IndexFileKey: process.env.S3_INDEX_FILE_KEY,
s3KeyPrefix: process.env.S3_KEY_PREFIX,
s3Region: process.env.S3_REGION,
Expand All @@ -43,6 +45,7 @@ export function getInputs() {
s3AccessKey: core.getInput('S3_ACCESS_KEY', { required: true }),
s3AccessKeyId: core.getInput('S3_ACCESS_KEY_ID', { required: true }),
s3Bucket: core.getInput('S3_BUCKET', { required: true }),
s3Endpoint: core.getInput('S3_ENDPOINT') || process.env.S3_ENDPOINT,
s3IndexFileKey: core.getInput('S3_INDEX_FILE_KEY'),
s3KeyPrefix: core.getInput('S3_KEY_PREFIX', { required: true }),
s3Region: core.getInput('S3_REGION', { required: true }),
Expand Down
5 changes: 2 additions & 3 deletions lib/utils/get-s3-client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { S3 } from '@aws-sdk/client-s3'
import process from 'node:process'

/**
* @param {Inputs} inputs
Expand All @@ -16,8 +15,8 @@ export function getS3Client(inputs) {
region: inputs.s3Region,
}

if (process.env.S3_ENDPOINT) {
options.endpoint = process.env.S3_ENDPOINT
if (inputs.s3Endpoint) {
options.endpoint = inputs.s3Endpoint
options.forcePathStyle = true
}

Expand Down
Loading