Explicitly set region for AWS S3 publishing

Fixes the following error:
`Error: Region is missing`
This commit is contained in:
Jakob Linskeseder
2026-03-18 21:13:05 +01:00
committed by Jay Linski
parent d025292e06
commit 6f1de2025e
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -34,5 +34,6 @@ jobs:
npm run publish:aws
env:
S3_BUCKET_NAME: 'builds.handlebarsjs.com'
S3_REGION: 'us-east-1'
S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
+3 -1
View File
@@ -35,10 +35,11 @@ async function main() {
function validateS3Env() {
const bucket = process.env.S3_BUCKET_NAME,
region = process.env.S3_REGION,
key = process.env.S3_ACCESS_KEY_ID,
secret = process.env.S3_SECRET_ACCESS_KEY;
if (!bucket || !key || !secret) {
if (!bucket || !region || !key || !secret) {
throw new Error('Missing S3 config values');
}
}
@@ -79,6 +80,7 @@ async function uploadToBucket(localFile, nameInBucket) {
function getS3Client() {
if (!s3Client) {
s3Client = new S3({
region: process.env.S3_REGION,
credentials: {
accessKeyId: process.env.S3_ACCESS_KEY_ID,
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,