#!/usr/bin/env bash # One bounded Stage acceptance only; never deploy, retry, reconcile or publish. set -euo pipefail set +x [[ $# == 0 && ${GITHUB_ACTIONS:-${GITEA_ACTIONS:-}} == true && ${BRANCH:-} == ci/v4-stage-resume-1a00-860324e && ${GITHUB_RUN_ATTEMPT:-} == 1 && ${DEPLOY_SHA:-} =~ ^[a-f0-9]{40}$ ]] || exit 2 # Separate workflow source SHA from the immutable, already-deployed Stage artifact. export DEPLOY_SHA=860324e3a91b31c2b6d4e784e458f6d120582cb8 export STAGE_TEST_APPROVAL=owner-authorized-stage-editorial export STAGE_TEST_SESSION=v4-ci-resume-1a00-20261024 export STAGE_TEST_TTL_SECONDS=600 wrapper="$(dirname "${BASH_SOURCE[0]}")/ci-stage-test-principal.sh" close() { rc=$? trap - EXIT HUP INT TERM export STAGE_TEST_ACTION=close if ! bash "$wrapper"; then printf 'Stage close pending: durable 600-second cleanup intent retained\n' >&2 rc=1 fi exit "$rc" } # Install before open: failed/partial open must also attempt generation-fenced close. trap close EXIT trap 'exit 130' INT trap 'exit 143' TERM HUP export STAGE_TEST_ACTION=open bash "$wrapper" export STAGE_TEST_ACTION=accept bash "$wrapper"