Skip to content

fix: pass env var#64

Merged
Perry2004 merged 1 commit intomainfrom
fix/pass-args
Nov 1, 2025
Merged

fix: pass env var#64
Perry2004 merged 1 commit intomainfrom
fix/pass-args

Conversation

@Perry2004
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings November 1, 2025 23:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies the S3 configuration validation by removing the redundant check for the key variable, which is hardcoded and therefore always defined. The changes update both the TypeScript lambda handler and the Dockerfile to reflect this simplification.

  • Removed unnecessary validation check for the hardcoded key variable in the lambda handler
  • Updated error messages to only reference S3_BUCKET_NAME as the required environment variable
  • Cleaned up Dockerfile to remove unused ARG declaration (though a duplicate ENV statement was introduced)

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
scripts/src/lambda-handler.ts Simplified validation logic to only check for bucketName since key is hardcoded and always defined
scripts/Dockerfile.script Removed unused ARG AWS_S3_BUCKET_NAME declaration and added ENV statement (resulting in duplicate)
Comments suppressed due to low confidence (1)

scripts/Dockerfile.script:28

  • The ENV S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME} statement is duplicated on lines 24 and 28. Remove the duplicate declaration.
ENV S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME}
RUN npx playwright install chromium --with-deps && \
    npx playwright install-deps chromium

ENV S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

RUN npm install aws-lambda-ric
RUN npm ci --only=production
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
ENV S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME}
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable S3_BUCKET_NAME is being set to ${AWS_S3_BUCKET_NAME}, but AWS_S3_BUCKET_NAME is no longer defined as an ARG (it was removed in this PR). This will result in S3_BUCKET_NAME being set to an empty string at build time. Either restore the ARG AWS_S3_BUCKET_NAME declaration or rely on the runtime environment to provide this variable and remove these ENV declarations.

Copilot uses AI. Check for mistakes.
@Perry2004 Perry2004 merged commit f9018b4 into main Nov 1, 2025
8 checks passed
@Perry2004 Perry2004 deleted the fix/pass-args branch November 1, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants