Skip to content

Commit

Permalink
feat: pass all NIXPACKS_ env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveitaly committed Oct 13, 2024
1 parent 55780f0 commit 19e1c03
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ repository_license() {
BUILD_CMD="nixpacks build $INPUT_CONTEXT"
GHCR_IMAGE_NAME="ghcr.io/$GITHUB_REPOSITORY"

# add NIXPACKS_ prefixed environment variables to the build command
# https://nixpacks.com/docs/configuration/environment
for var in $(env | grep ^NIXPACKS_); do
BUILD_CMD="$BUILD_CMD --env $var"
done

# Incorporate provided input parameters from actions.yml into the Nixpacks build command
if [ -n "${INPUT_TAGS}" ]; then
read -ra TAGS <<<"$(echo "$INPUT_TAGS" | tr ',\n' ' ')"
Expand Down Expand Up @@ -73,6 +79,7 @@ if [ -n "$REPO_LICENSE" ]; then
fi

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

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

0 comments on commit 19e1c03

Please sign in to comment.