Skip to content

Commit 19e1c03

Browse files
committed
feat: pass all NIXPACKS_ env vars
1 parent 55780f0 commit 19e1c03

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ repository_license() {
4343
BUILD_CMD="nixpacks build $INPUT_CONTEXT"
4444
GHCR_IMAGE_NAME="ghcr.io/$GITHUB_REPOSITORY"
4545

46+
# add NIXPACKS_ prefixed environment variables to the build command
47+
# https://nixpacks.com/docs/configuration/environment
48+
for var in $(env | grep ^NIXPACKS_); do
49+
BUILD_CMD="$BUILD_CMD --env $var"
50+
done
51+
4652
# Incorporate provided input parameters from actions.yml into the Nixpacks build command
4753
if [ -n "${INPUT_TAGS}" ]; then
4854
read -ra TAGS <<<"$(echo "$INPUT_TAGS" | tr ',\n' ' ')"
@@ -73,6 +79,7 @@ if [ -n "$REPO_LICENSE" ]; then
7379
fi
7480

7581
# TODO add the description label as well? Does this add any value?
82+
# TODO add org.opencontainers.image.title?
7683

7784
for label in "${LABELS[@]}"; do
7885
BUILD_CMD="$BUILD_CMD --label $label"

0 commit comments

Comments
 (0)