21 lines
792 B
Bash
Executable File
21 lines
792 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Install the app's dependencies with the action's install-command, run in the
|
|
# repo root under bash -eo pipefail like any run step. The output is kept, so a
|
|
# failure shows its tail on the build page, and a failure closes the build
|
|
# record (build_failed) instead of leaving the run "running" until it goes
|
|
# stale. Set up Node.js, the step before, ends here.
|
|
set -euo pipefail
|
|
. "$(dirname "$0")/lib.sh"
|
|
step_next node install
|
|
cmd="${INSTALL_COMMAND:-npm install --no-audit --no-fund}"
|
|
|
|
logf="$(mktemp)"
|
|
printf '$ %s\n' "$cmd"
|
|
set +e
|
|
bash -eo pipefail -c "$cmd" 2>&1 | tee "$logf"
|
|
rc=${PIPESTATUS[0]}
|
|
set -e
|
|
[ "$rc" = 0 ] || fail_build build_failed "Installing dependencies failed (exit code $rc); nothing was published." "$logf"
|
|
rm -f "$logf"
|
|
step_done install passed
|