Skip to content

Commit e2fd263

Browse files
committed
fix: Expose plan_json_file output for summary step. Avoid passing large
PLAN_JSON via outputs/env which can exceed Linux ARG_MAX (~2MB) and cause E2BIG; write the plan JSON to a tempfile and provide its path as plan_json_file for the summary step.
1 parent deacdb8 commit e2fd263

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

action.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,13 @@ runs:
500500
echo "plan_json=${PLAN_JSON}"
501501
} >> "$GITHUB_OUTPUT"
502502
503+
# Write plan JSON to a temp file for the Summary step.
504+
# Passing it as an env var can exceed Linux's ARG_MAX (~2MB) and
505+
# cause E2BIG ("Argument list too long") on large workspaces.
506+
PLAN_JSON_FILE="${RUNNER_TEMP}/cargo-rail-plan.json"
507+
printf '%s' "$PLAN_JSON" > "$PLAN_JSON_FILE"
508+
echo "plan_json_file=${PLAN_JSON_FILE}" >> "$GITHUB_OUTPUT"
509+
503510
# Emit individual outputs for each custom surface (P0: native custom surface outputs)
504511
# This eliminates the need for jq extraction in downstream workflows
505512
if [[ -n "${CUSTOM_SURFACES:-}" && "$CUSTOM_SURFACES" != "{}" ]]; then
@@ -543,13 +550,13 @@ runs:
543550
INSTALL_METHOD: ${{ steps.install.outputs.method }}
544551
INSTALL_VERSION: ${{ steps.install.outputs.version }}
545552
BASE_REF: ${{ steps.base.outputs.ref }}
546-
PLAN_JSON: ${{ steps.plan.outputs.plan_json }}
553+
PLAN_JSON_FILE: ${{ steps.plan.outputs.plan_json_file }}
547554
run: |
548555
set -euo pipefail
549556
PYTHON_BIN="python3"
550557
command -v python3 >/dev/null 2>&1 || PYTHON_BIN="python"
551558
"$PYTHON_BIN" "${{ github.action_path }}/scripts/render_summary.py" \
552-
--plan-json "$PLAN_JSON" \
559+
--plan-json-file "$PLAN_JSON_FILE" \
553560
--install-method "$INSTALL_METHOD" \
554561
--install-version "$INSTALL_VERSION" \
555562
--base-ref "$BASE_REF" >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)