From e5b9c2910a9bbe6faa4f8ddab6c2c748e8d8d6f8 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Tue, 20 May 2025 23:20:09 +1000 Subject: [PATCH 01/21] Update entrypoint.sh fix: replace deprecated `set-output` with `GITHUB_OUTPUT` --- cli/entrypoint.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 890fbe3..8993a99 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -15,7 +15,10 @@ NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') #Unique key: app.netlify.com NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") #Unique key: don't containr -- and app.netlify.com -echo "::set-output name=NETLIFY_OUTPUT::$NETLIFY_OUTPUT" -echo "::set-output name=NETLIFY_URL::$NETLIFY_URL" -echo "::set-output name=NETLIFY_LOGS_URL::$NETLIFY_LOGS_URL" -echo "::set-output name=NETLIFY_LIVE_URL::$NETLIFY_LIVE_URL" +{ + echo "NETLIFY_OUTPUT=$NETLIFY_OUTPUT" + echo "NETLIFY_URL=$NETLIFY_URL" + echo "NETLIFY_LOGS_URL=$NETLIFY_LOGS_URL" + echo "NETLIFY_LIVE_URL=$NETLIFY_LIVE_URL" +} >> "$GITHUB_OUTPUT" + From e49192e75936a0ca8f1eca25dc4ad58ab12aee6e Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Tue, 20 May 2025 23:35:18 +1000 Subject: [PATCH 02/21] Update entrypoint.sh --- cli/entrypoint.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 8993a99..06b9519 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -15,10 +15,9 @@ NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') #Unique key: app.netlify.com NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") #Unique key: don't containr -- and app.netlify.com -{ - echo "NETLIFY_OUTPUT=$NETLIFY_OUTPUT" - echo "NETLIFY_URL=$NETLIFY_URL" - echo "NETLIFY_LOGS_URL=$NETLIFY_LOGS_URL" - echo "NETLIFY_LIVE_URL=$NETLIFY_LIVE_URL" -} >> "$GITHUB_OUTPUT" +[ -n "$NETLIFY_OUTPUT" ] && echo "NETLIFY_OUTPUT=$NETLIFY_OUTPUT" >> "$GITHUB_OUTPUT" +[ -n "$NETLIFY_URL" ] && echo "NETLIFY_URL=$NETLIFY_URL" >> "$GITHUB_OUTPUT" +[ -n "$NETLIFY_LOGS_URL" ] && echo "NETLIFY_LOGS_URL=$NETLIFY_LOGS_URL" >> "$GITHUB_OUTPUT" +[ -n "$NETLIFY_LIVE_URL" ] && echo "NETLIFY_LIVE_URL=$NETLIFY_LIVE_URL" >> "$GITHUB_OUTPUT" + From bc2965ee2835c2cc249adad31d822d713817c2b4 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Tue, 20 May 2025 23:46:17 +1000 Subject: [PATCH 03/21] Update entrypoint.sh --- cli/entrypoint.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 06b9519..5e174ff 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -15,9 +15,16 @@ NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') #Unique key: app.netlify.com NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") #Unique key: don't containr -- and app.netlify.com -[ -n "$NETLIFY_OUTPUT" ] && echo "NETLIFY_OUTPUT=$NETLIFY_OUTPUT" >> "$GITHUB_OUTPUT" -[ -n "$NETLIFY_URL" ] && echo "NETLIFY_URL=$NETLIFY_URL" >> "$GITHUB_OUTPUT" -[ -n "$NETLIFY_LOGS_URL" ] && echo "NETLIFY_LOGS_URL=$NETLIFY_LOGS_URL" >> "$GITHUB_OUTPUT" -[ -n "$NETLIFY_LIVE_URL" ] && echo "NETLIFY_LIVE_URL=$NETLIFY_LIVE_URL" >> "$GITHUB_OUTPUT" - +# Function to safely write outputs +safe_output() { + local name="$1" + local value="$2" + if [ -n "$value" ]; then + echo "${name}=${value}" >> "$GITHUB_OUTPUT" + fi +} +safe_output "NETLIFY_OUTPUT" "$NETLIFY_OUTPUT" +safe_output "NETLIFY_URL" "$NETLIFY_URL" +safe_output "NETLIFY_LOGS_URL" "$NETLIFY_LOGS_URL" +safe_output "NETLIFY_LIVE_URL" "$NETLIFY_LIVE_URL" From 3327bc2040f2d24dfa4b882a5aba6b370d3023a6 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Tue, 20 May 2025 23:57:45 +1000 Subject: [PATCH 04/21] Update entrypoint.sh --- cli/entrypoint.sh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 5e174ff..6b47d12 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -1,29 +1,46 @@ #!/bin/sh -l +# Build the command read -d '' COMMAND <<- EOF if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then echo "$BUILD_DIR didn't change" else - ${BUILD_COMMAND:-echo} && netlify $* + ${BUILD_COMMAND:-echo} && netlify "$@" fi EOF +# Execute the command and capture output OUTPUT=$(sh -c "$COMMAND") +# Extract values using grep patterns NETLIFY_OUTPUT=$(echo "$OUTPUT") -NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') #Unique key: -- -NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') #Unique key: app.netlify.com -NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") #Unique key: don't containr -- and app.netlify.com +NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') +NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') +NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") # Function to safely write outputs safe_output() { local name="$1" local value="$2" + + # Strip control characters (e.g., zero-width space) + value=$(echo "$value" | tr -cd '[:print:]\n\r') + if [ -n "$value" ]; then echo "${name}=${value}" >> "$GITHUB_OUTPUT" fi } +# Optional debugging (uncomment to inspect) +# echo "==== RAW OUTPUT ====" +# echo "$OUTPUT" +# echo "==== DEBUG OUTPUTS ====" +# echo "NETLIFY_OUTPUT: $(echo "$NETLIFY_OUTPUT" | od -c)" +# echo "NETLIFY_URL: $(echo "$NETLIFY_URL" | od -c)" +# echo "NETLIFY_LOGS_URL: $(echo "$NETLIFY_LOGS_URL" | od -c)" +# echo "NETLIFY_LIVE_URL: $(echo "$NETLIFY_LIVE_URL" | od -c)" + +# Write outputs safe_output "NETLIFY_OUTPUT" "$NETLIFY_OUTPUT" safe_output "NETLIFY_URL" "$NETLIFY_URL" safe_output "NETLIFY_LOGS_URL" "$NETLIFY_LOGS_URL" From c9d9511573fc81f2033a6c32fd4302f6e625f178 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 00:06:22 +1000 Subject: [PATCH 05/21] Update entrypoint.sh --- cli/entrypoint.sh | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 6b47d12..97b6fad 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -1,46 +1,30 @@ #!/bin/sh -l -# Build the command read -d '' COMMAND <<- EOF - if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then - echo "$BUILD_DIR didn't change" + if [ -f "\$HOME/ignore" ] && grep "^ignore:\$BUILD_DIR" "\$HOME/ignore"; then + echo "\$BUILD_DIR didn't change" else - ${BUILD_COMMAND:-echo} && netlify "$@" + ${BUILD_COMMAND:-echo} && netlify $* fi EOF -# Execute the command and capture output OUTPUT=$(sh -c "$COMMAND") -# Extract values using grep patterns NETLIFY_OUTPUT=$(echo "$OUTPUT") NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") -# Function to safely write outputs +# Safe writer to avoid invalid output errors safe_output() { local name="$1" local value="$2" - - # Strip control characters (e.g., zero-width space) value=$(echo "$value" | tr -cd '[:print:]\n\r') - if [ -n "$value" ]; then echo "${name}=${value}" >> "$GITHUB_OUTPUT" fi } -# Optional debugging (uncomment to inspect) -# echo "==== RAW OUTPUT ====" -# echo "$OUTPUT" -# echo "==== DEBUG OUTPUTS ====" -# echo "NETLIFY_OUTPUT: $(echo "$NETLIFY_OUTPUT" | od -c)" -# echo "NETLIFY_URL: $(echo "$NETLIFY_URL" | od -c)" -# echo "NETLIFY_LOGS_URL: $(echo "$NETLIFY_LOGS_URL" | od -c)" -# echo "NETLIFY_LIVE_URL: $(echo "$NETLIFY_LIVE_URL" | od -c)" - -# Write outputs safe_output "NETLIFY_OUTPUT" "$NETLIFY_OUTPUT" safe_output "NETLIFY_URL" "$NETLIFY_URL" safe_output "NETLIFY_LOGS_URL" "$NETLIFY_LOGS_URL" From 2a564247f09103ed892c40bb373f0cee042fed2d Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 00:28:22 +1000 Subject: [PATCH 06/21] Update entrypoint.sh --- cli/entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 97b6fad..32d1162 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -10,6 +10,9 @@ EOF OUTPUT=$(sh -c "$COMMAND") +echo "🪵 RAW CLI OUTPUT:" +echo "$OUTPUT" | od -c # This shows non-printable chars as octal escapes + NETLIFY_OUTPUT=$(echo "$OUTPUT") NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') From 558da970d20dd480789f40e913039963b290d686 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 00:37:25 +1000 Subject: [PATCH 07/21] Update entrypoint.sh --- cli/entrypoint.sh | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 32d1162..6c3baf9 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -1,28 +1,39 @@ #!/bin/sh -l +# Disable terminal formatting from Netlify CLI +export TERM=dumb + +# Build the command block read -d '' COMMAND <<- EOF if [ -f "\$HOME/ignore" ] && grep "^ignore:\$BUILD_DIR" "\$HOME/ignore"; then echo "\$BUILD_DIR didn't change" else - ${BUILD_COMMAND:-echo} && netlify $* + ${BUILD_COMMAND:-echo} && netlify "$@" fi EOF -OUTPUT=$(sh -c "$COMMAND") +# Execute command and capture raw output +RAW_OUTPUT=$(sh -c "$COMMAND" 2>&1) + +# Strip ANSI escape sequences and Unicode line art safely +SANITIZED_OUTPUT=$(echo "$RAW_OUTPUT" | perl -pe 's/\e\[?.*?[\@-~]//g' | iconv -f utf-8 -t ascii//TRANSLIT) -echo "🪵 RAW CLI OUTPUT:" -echo "$OUTPUT" | od -c # This shows non-printable chars as octal escapes +# Optional: debug dump +echo "🪵 RAW OUTPUT:" +echo "$RAW_OUTPUT" | od -c | head -40 +echo "🪵 CLEAN OUTPUT:" +echo "$SANITIZED_OUTPUT" -NETLIFY_OUTPUT=$(echo "$OUTPUT") -NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') -NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') -NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") +# Parse values +NETLIFY_OUTPUT="$SANITIZED_OUTPUT" +NETLIFY_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') +NETLIFY_LOGS_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') +NETLIFY_LIVE_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") -# Safe writer to avoid invalid output errors +# Safe writer to GitHub output safe_output() { local name="$1" local value="$2" - value=$(echo "$value" | tr -cd '[:print:]\n\r') if [ -n "$value" ]; then echo "${name}=${value}" >> "$GITHUB_OUTPUT" fi From 5b075b7769b8e64d0a5add661c686f305a8f1156 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 00:47:14 +1000 Subject: [PATCH 08/21] Update Dockerfile --- cli/Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cli/Dockerfile b/cli/Dockerfile index 8c6b523..4d1f843 100644 --- a/cli/Dockerfile +++ b/cli/Dockerfile @@ -1,5 +1,12 @@ FROM node:22-alpine +# Add required tools: perl for stripping ANSI escape sequences +RUN apk add --no-cache perl + +# Install Netlify CLI +RUN npm install -g netlify-cli + +# Action metadata (optional) LABEL version="2.0.0" LABEL repository="http://github.com/netlify/actions" LABEL homepage="http://github.com/netlify/actions/netlify" @@ -9,7 +16,5 @@ LABEL "com.github.actions.description"="Wraps the Netlify CLI to enable common N LABEL "com.github.actions.icon"="cloud" LABEL "com.github.actions.color"="blue" -RUN npm install -g netlify-cli - COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] From 4abda7d19efadbdc4318e0a38edbdc0499a2684d Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 00:47:55 +1000 Subject: [PATCH 09/21] Update entrypoint.sh --- cli/entrypoint.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 6c3baf9..30a907d 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/sh -l -# Disable terminal formatting from Netlify CLI +# Disable formatting from Netlify CLI export TERM=dumb # Build the command block @@ -12,25 +12,25 @@ read -d '' COMMAND <<- EOF fi EOF -# Execute command and capture raw output +# Execute command and capture raw output (stdout + stderr) RAW_OUTPUT=$(sh -c "$COMMAND" 2>&1) -# Strip ANSI escape sequences and Unicode line art safely -SANITIZED_OUTPUT=$(echo "$RAW_OUTPUT" | perl -pe 's/\e\[?.*?[\@-~]//g' | iconv -f utf-8 -t ascii//TRANSLIT) +# Strip ANSI escape sequences (e.g. \033[31m) and remove non-printables +SANITIZED_OUTPUT=$(echo "$RAW_OUTPUT" | perl -pe 's/\e\[?.*?[\@-~]//g' | tr -cd '[:print:]\n\r') -# Optional: debug dump +# Optional debug echo "🪵 RAW OUTPUT:" echo "$RAW_OUTPUT" | od -c | head -40 echo "🪵 CLEAN OUTPUT:" echo "$SANITIZED_OUTPUT" -# Parse values +# Parse sanitized output for relevant Netlify URLs NETLIFY_OUTPUT="$SANITIZED_OUTPUT" NETLIFY_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') NETLIFY_LOGS_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') NETLIFY_LIVE_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") -# Safe writer to GitHub output +# Write sanitized values to GitHub output file safe_output() { local name="$1" local value="$2" From 7350d693e54d4cd0661dd9ef3c315f2a26f83800 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 00:55:16 +1000 Subject: [PATCH 10/21] Update entrypoint.sh --- cli/entrypoint.sh | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 30a907d..371dd15 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -1,9 +1,8 @@ #!/bin/sh -l -# Disable formatting from Netlify CLI export TERM=dumb -# Build the command block +# Build command to run netlify read -d '' COMMAND <<- EOF if [ -f "\$HOME/ignore" ] && grep "^ignore:\$BUILD_DIR" "\$HOME/ignore"; then echo "\$BUILD_DIR didn't change" @@ -12,25 +11,35 @@ read -d '' COMMAND <<- EOF fi EOF -# Execute command and capture raw output (stdout + stderr) +# Run command and capture status RAW_OUTPUT=$(sh -c "$COMMAND" 2>&1) +EXIT_CODE=$? -# Strip ANSI escape sequences (e.g. \033[31m) and remove non-printables -SANITIZED_OUTPUT=$(echo "$RAW_OUTPUT" | perl -pe 's/\e\[?.*?[\@-~]//g' | tr -cd '[:print:]\n\r') - -# Optional debug +# Debug dump (optional) echo "🪵 RAW OUTPUT:" echo "$RAW_OUTPUT" | od -c | head -40 + +# Fail if command did not succeed +if [ $EXIT_CODE -ne 0 ]; then + echo "❌ Netlify CLI command failed (exit code $EXIT_CODE)" + echo "$RAW_OUTPUT" + exit $EXIT_CODE +fi + +# Strip ANSI escape sequences and non-printables +SANITIZED_OUTPUT=$(echo "$RAW_OUTPUT" | perl -pe 's/\e\[?.*?[\@-~]//g' | tr -cd '[:print:]\n\r') + +# Debug sanitized output echo "🪵 CLEAN OUTPUT:" echo "$SANITIZED_OUTPUT" -# Parse sanitized output for relevant Netlify URLs +# Extract values NETLIFY_OUTPUT="$SANITIZED_OUTPUT" NETLIFY_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') NETLIFY_LOGS_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') NETLIFY_LIVE_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") -# Write sanitized values to GitHub output file +# Safely write outputs safe_output() { local name="$1" local value="$2" From f016bb2b476f8ad411c71d349757bb614795aeb4 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 07:35:25 +1000 Subject: [PATCH 11/21] Update entrypoint.sh --- cli/entrypoint.sh | 76 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 371dd15..dcbb7a6 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -2,44 +2,90 @@ export TERM=dumb -# Build command to run netlify -read -d '' COMMAND <<- EOF - if [ -f "\$HOME/ignore" ] && grep "^ignore:\$BUILD_DIR" "\$HOME/ignore"; then - echo "\$BUILD_DIR didn't change" - else - ${BUILD_COMMAND:-echo} && netlify "$@" +# Skip if this build dir is ignored +if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then + echo "$BUILD_DIR didn't change" + exit 0 +fi + +# Run the Netlify CLI with passed args and capture output +RAW_OUTPUT=$(netlify "$@" 2>&1) +EXIT_CODE=$? + +# Debug: show raw output +echo "🪵 RAW OUTPUT:" +echo "$RAW_OUTPUT" | od -c | head -40 + +# Fail early if the command errored +if [ $EXIT_CODE -ne 0 ]; then + echo "❌ Netlify CLI command failed (exit code $EXIT_CODE)" + echo "$RAW_OUTPUT" + exit $EXIT_CODE +fi + +# Sanitize output +SANITIZED_OUTPUT=$(echo "$RAW_OUTPUT" | perl -pe 's/\e\[?.*?[\@-~]//g' | tr -cd '[:print:]\n\r') + +echo "🪵 CLEAN OUTPUT:" +echo "$SANITIZED_OUTPUT" + +# Parse output +NETLIFY_OUTPUT="$SANITIZED_OUTPUT" +NETLIFY_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') +NETLIFY_LOGS_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') +NETLIFY_LIVE_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") + +# Output to GitHub environment +safe_output() { + local name="$1" + local value="$2" + if [ -n "$value" ]; then + echo "${name}=${value}" >> "$GITHUB_OUTPUT" fi -EOF +} + +safe_output "NETLIFY_OUTPUT" "$NETLIFY_OUTPUT" +safe_output "NETLIFY_URL" "$NETLIFY_URL" +safe_output "NETLIFY_LOGS_URL" "$NETLIFY_LOGS_URL" +safe_output "NETLIFY_LIVE_URL" "$NETLIFY_LIVE_URL" +#!/bin/sh -l + +export TERM=dumb + +# Skip if this build dir is ignored +if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then + echo "$BUILD_DIR didn't change" + exit 0 +fi -# Run command and capture status -RAW_OUTPUT=$(sh -c "$COMMAND" 2>&1) +# Run the Netlify CLI with passed args and capture output +RAW_OUTPUT=$(netlify "$@" 2>&1) EXIT_CODE=$? -# Debug dump (optional) +# Debug: show raw output echo "🪵 RAW OUTPUT:" echo "$RAW_OUTPUT" | od -c | head -40 -# Fail if command did not succeed +# Fail early if the command errored if [ $EXIT_CODE -ne 0 ]; then echo "❌ Netlify CLI command failed (exit code $EXIT_CODE)" echo "$RAW_OUTPUT" exit $EXIT_CODE fi -# Strip ANSI escape sequences and non-printables +# Sanitize output SANITIZED_OUTPUT=$(echo "$RAW_OUTPUT" | perl -pe 's/\e\[?.*?[\@-~]//g' | tr -cd '[:print:]\n\r') -# Debug sanitized output echo "🪵 CLEAN OUTPUT:" echo "$SANITIZED_OUTPUT" -# Extract values +# Parse output NETLIFY_OUTPUT="$SANITIZED_OUTPUT" NETLIFY_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') NETLIFY_LOGS_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') NETLIFY_LIVE_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") -# Safely write outputs +# Output to GitHub environment safe_output() { local name="$1" local value="$2" From 14c79d7301eec65dfecb4bfb080333ee80b91c1c Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 07:46:08 +1000 Subject: [PATCH 12/21] Update Dockerfile --- cli/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/Dockerfile b/cli/Dockerfile index 4d1f843..9e2f238 100644 --- a/cli/Dockerfile +++ b/cli/Dockerfile @@ -1,8 +1,5 @@ FROM node:22-alpine -# Add required tools: perl for stripping ANSI escape sequences -RUN apk add --no-cache perl - # Install Netlify CLI RUN npm install -g netlify-cli @@ -16,5 +13,9 @@ LABEL "com.github.actions.description"="Wraps the Netlify CLI to enable common N LABEL "com.github.actions.icon"="cloud" LABEL "com.github.actions.color"="blue" +# Copy entrypoint COPY entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] +RUN chmod +x /entrypoint.sh + +# Use shell entrypoint that preserves "$@" +ENTRYPOINT ["sh", "-c", "/entrypoint.sh \"$@\""] From 348e04d59c1b385dc09e0e3e3e5820bab7477321 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 07:47:45 +1000 Subject: [PATCH 13/21] Update entrypoint.sh --- cli/entrypoint.sh | 111 +++++++--------------------------------------- 1 file changed, 17 insertions(+), 94 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index dcbb7a6..29a6ddc 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -1,100 +1,23 @@ #!/bin/sh -l -export TERM=dumb - -# Skip if this build dir is ignored -if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then - echo "$BUILD_DIR didn't change" - exit 0 -fi - -# Run the Netlify CLI with passed args and capture output -RAW_OUTPUT=$(netlify "$@" 2>&1) -EXIT_CODE=$? - -# Debug: show raw output -echo "🪵 RAW OUTPUT:" -echo "$RAW_OUTPUT" | od -c | head -40 - -# Fail early if the command errored -if [ $EXIT_CODE -ne 0 ]; then - echo "❌ Netlify CLI command failed (exit code $EXIT_CODE)" - echo "$RAW_OUTPUT" - exit $EXIT_CODE -fi - -# Sanitize output -SANITIZED_OUTPUT=$(echo "$RAW_OUTPUT" | perl -pe 's/\e\[?.*?[\@-~]//g' | tr -cd '[:print:]\n\r') - -echo "🪵 CLEAN OUTPUT:" -echo "$SANITIZED_OUTPUT" - -# Parse output -NETLIFY_OUTPUT="$SANITIZED_OUTPUT" -NETLIFY_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') -NETLIFY_LOGS_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') -NETLIFY_LIVE_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") - -# Output to GitHub environment -safe_output() { - local name="$1" - local value="$2" - if [ -n "$value" ]; then - echo "${name}=${value}" >> "$GITHUB_OUTPUT" +read -d '' COMMAND <<- EOF + if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then + echo "$BUILD_DIR didn't change" + else + ${BUILD_COMMAND:-echo} && netlify $* fi -} - -safe_output "NETLIFY_OUTPUT" "$NETLIFY_OUTPUT" -safe_output "NETLIFY_URL" "$NETLIFY_URL" -safe_output "NETLIFY_LOGS_URL" "$NETLIFY_LOGS_URL" -safe_output "NETLIFY_LIVE_URL" "$NETLIFY_LIVE_URL" -#!/bin/sh -l - -export TERM=dumb - -# Skip if this build dir is ignored -if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then - echo "$BUILD_DIR didn't change" - exit 0 -fi - -# Run the Netlify CLI with passed args and capture output -RAW_OUTPUT=$(netlify "$@" 2>&1) -EXIT_CODE=$? - -# Debug: show raw output -echo "🪵 RAW OUTPUT:" -echo "$RAW_OUTPUT" | od -c | head -40 +EOF -# Fail early if the command errored -if [ $EXIT_CODE -ne 0 ]; then - echo "❌ Netlify CLI command failed (exit code $EXIT_CODE)" - echo "$RAW_OUTPUT" - exit $EXIT_CODE -fi +OUTPUT=$(sh -c "$COMMAND") -# Sanitize output -SANITIZED_OUTPUT=$(echo "$RAW_OUTPUT" | perl -pe 's/\e\[?.*?[\@-~]//g' | tr -cd '[:print:]\n\r') - -echo "🪵 CLEAN OUTPUT:" -echo "$SANITIZED_OUTPUT" - -# Parse output -NETLIFY_OUTPUT="$SANITIZED_OUTPUT" -NETLIFY_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') -NETLIFY_LOGS_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') -NETLIFY_LIVE_URL=$(echo "$SANITIZED_OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") - -# Output to GitHub environment -safe_output() { - local name="$1" - local value="$2" - if [ -n "$value" ]; then - echo "${name}=${value}" >> "$GITHUB_OUTPUT" - fi -} +NETLIFY_OUTPUT=$(echo "$OUTPUT") +NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') +NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') +NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") -safe_output "NETLIFY_OUTPUT" "$NETLIFY_OUTPUT" -safe_output "NETLIFY_URL" "$NETLIFY_URL" -safe_output "NETLIFY_LOGS_URL" "$NETLIFY_LOGS_URL" -safe_output "NETLIFY_LIVE_URL" "$NETLIFY_LIVE_URL" +{ + echo "NETLIFY_OUTPUT=$NETLIFY_OUTPUT" + echo "NETLIFY_URL=$NETLIFY_URL" + echo "NETLIFY_LOGS_URL=$NETLIFY_LOGS_URL" + echo "NETLIFY_LIVE_URL=$NETLIFY_LIVE_URL" +} >> "$GITHUB_OUTPUT" From 3635cda7da20622bc5bbcb2930e078b912c4faff Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 08:04:16 +1000 Subject: [PATCH 14/21] Update Dockerfile --- cli/Dockerfile | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/cli/Dockerfile b/cli/Dockerfile index 9e2f238..8c6b523 100644 --- a/cli/Dockerfile +++ b/cli/Dockerfile @@ -1,9 +1,5 @@ FROM node:22-alpine -# Install Netlify CLI -RUN npm install -g netlify-cli - -# Action metadata (optional) LABEL version="2.0.0" LABEL repository="http://github.com/netlify/actions" LABEL homepage="http://github.com/netlify/actions/netlify" @@ -13,9 +9,7 @@ LABEL "com.github.actions.description"="Wraps the Netlify CLI to enable common N LABEL "com.github.actions.icon"="cloud" LABEL "com.github.actions.color"="blue" -# Copy entrypoint -COPY entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh +RUN npm install -g netlify-cli -# Use shell entrypoint that preserves "$@" -ENTRYPOINT ["sh", "-c", "/entrypoint.sh \"$@\""] +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] From c05c636f86364b4d8bef25d6575546fa33be0d53 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 08:06:51 +1000 Subject: [PATCH 15/21] Update entrypoint.sh --- cli/entrypoint.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 29a6ddc..44f6072 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -8,12 +8,14 @@ read -d '' COMMAND <<- EOF fi EOF +echo "running ${COMMAND}" OUTPUT=$(sh -c "$COMMAND") +echo "$OUTPUT" NETLIFY_OUTPUT=$(echo "$OUTPUT") -NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') -NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') -NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") +NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') #Unique key: -- +NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') #Unique key: app.netlify.com +NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") #Unique key: don't containr -- and app.netlify.com { echo "NETLIFY_OUTPUT=$NETLIFY_OUTPUT" From 090bd1ad718fe12a9d39bf48c308102bbd509394 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 08:42:44 +1000 Subject: [PATCH 16/21] Update entrypoint.sh --- cli/entrypoint.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 44f6072..776619f 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -4,7 +4,7 @@ read -d '' COMMAND <<- EOF if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then echo "$BUILD_DIR didn't change" else - ${BUILD_COMMAND:-echo} && netlify $* + ${BUILD_COMMAND:-echo} && netlify "$@" fi EOF @@ -12,13 +12,11 @@ echo "running ${COMMAND}" OUTPUT=$(sh -c "$COMMAND") echo "$OUTPUT" -NETLIFY_OUTPUT=$(echo "$OUTPUT") -NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') #Unique key: -- -NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') #Unique key: app.netlify.com -NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") #Unique key: don't containr -- and app.netlify.com +NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(https?://[^ ]*--[^ ]*\.netlify\.app)') +NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo 'https://app\.netlify\.com/[^ ]*') +NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo 'https://[^ ]*\.stackql\.io') { - echo "NETLIFY_OUTPUT=$NETLIFY_OUTPUT" echo "NETLIFY_URL=$NETLIFY_URL" echo "NETLIFY_LOGS_URL=$NETLIFY_LOGS_URL" echo "NETLIFY_LIVE_URL=$NETLIFY_LIVE_URL" From 9dc13512fb0db449e53c021da526bc30f9735252 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 08:55:57 +1000 Subject: [PATCH 17/21] Update Dockerfile --- cli/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/Dockerfile b/cli/Dockerfile index 8c6b523..8d7558e 100644 --- a/cli/Dockerfile +++ b/cli/Dockerfile @@ -12,4 +12,5 @@ LABEL "com.github.actions.color"="blue" RUN npm install -g netlify-cli COPY entrypoint.sh /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["sh", "/entrypoint.sh"] From d5b82208ee54cc61d76c84a88917218445ca7c8d Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 09:09:12 +1000 Subject: [PATCH 18/21] Update entrypoint.sh --- cli/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index 776619f..b655e2a 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -4,7 +4,7 @@ read -d '' COMMAND <<- EOF if [ -f "$HOME/ignore" ] && grep "^ignore:$BUILD_DIR" "$HOME/ignore"; then echo "$BUILD_DIR didn't change" else - ${BUILD_COMMAND:-echo} && netlify "$@" + ${BUILD_COMMAND:-echo} && netlify $@ fi EOF From f89d09543d509106e8c2a4121e7a165d9e21be5d Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 09:22:45 +1000 Subject: [PATCH 19/21] Update entrypoint.sh --- cli/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index b655e2a..ffe06f3 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -12,9 +12,9 @@ echo "running ${COMMAND}" OUTPUT=$(sh -c "$COMMAND") echo "$OUTPUT" -NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(https?://[^ ]*--[^ ]*\.netlify\.app)') -NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo 'https://app\.netlify\.com/[^ ]*') -NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo 'https://[^ ]*\.stackql\.io') +NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') #Unique key: -- +NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') #Unique key: app.netlify.com +NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") #Unique key: don't containr -- and app.netlify.com { echo "NETLIFY_URL=$NETLIFY_URL" From e5cc4a6d599f2e84929fea9160fd6fe2186c95a8 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 09:32:38 +1000 Subject: [PATCH 20/21] Update entrypoint.sh --- cli/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/entrypoint.sh b/cli/entrypoint.sh index ffe06f3..f3dc6aa 100755 --- a/cli/entrypoint.sh +++ b/cli/entrypoint.sh @@ -12,9 +12,9 @@ echo "running ${COMMAND}" OUTPUT=$(sh -c "$COMMAND") echo "$OUTPUT" -NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') #Unique key: -- -NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') #Unique key: app.netlify.com -NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") #Unique key: don't containr -- and app.netlify.com +NETLIFY_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*' | head -n 1) +NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep "Build logs:" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*' | head -n 1) +NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -i "production URL:" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | head -n 1) { echo "NETLIFY_URL=$NETLIFY_URL" From da881d26704ae29e7f9d1adf536411ed6ae98c16 Mon Sep 17 00:00:00 2001 From: Jeffrey Aven Date: Wed, 21 May 2025 09:47:30 +1000 Subject: [PATCH 21/21] Update README.md --- cli/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/README.md b/cli/README.md index ee95e7e..c256dc2 100644 --- a/cli/README.md +++ b/cli/README.md @@ -11,11 +11,13 @@ This Action enables arbitrary actions with the [Netlify CLI](https://github.com/ ## Outputs The following outputs will be available from a step that uses this action: -- `NETLIFY_OUTPUT`, the full stdout from the run of the `netlify` command - `NETLIFY_URL`, the URL of the draft site that Netlify provides - `NETLIFY_LOGS_URL`, the URL where the logs from the deploy can be found - `NETLIFY_LIVE_URL`, the URL of the "real" site, set only if `--prod` was passed +> The full stdout from the run of the `netlify` command is printed in the GitHub Actions workflow logs. + + See [the documentation](https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions) for info and examples of how to use outputs in later steps and jobs. ## Example @@ -33,7 +35,7 @@ jobs: - name: Publish uses: netlify/actions/cli@master with: - args: deploy --dir=site --functions=functions + args: deploy --prod --dir=./build --message="Deploy from Github Action" env: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}