diff --git a/internal/scaffold/fullsend-repo/scripts/post-fix.sh b/internal/scaffold/fullsend-repo/scripts/post-fix.sh index e055fd30c..afcdfc634 100644 --- a/internal/scaffold/fullsend-repo/scripts/post-fix.sh +++ b/internal/scaffold/fullsend-repo/scripts/post-fix.sh @@ -301,8 +301,17 @@ fi export GH_TOKEN="${PUSH_TOKEN}" # Locate process-fix-result.py relative to this script. +# When this script runs from a content-addressed cache path +# (sha256//content), companion files are not co-located. +# Fall back to ${FULLSEND_DIR}/scripts if the companion is missing. +# FULLSEND_DIR is required (fail-closed) to avoid silently resolving to cwd. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROCESS_SCRIPT="${SCRIPT_DIR}/process-fix-result.py" +if [ ! -f "${PROCESS_SCRIPT}" ] && [ -d "${FULLSEND_DIR:?FULLSEND_DIR must be set}/scripts" ]; then + SCRIPT_DIR="${FULLSEND_DIR}/scripts" + PROCESS_SCRIPT="${SCRIPT_DIR}/process-fix-result.py" + echo "Using fallback companion path: ${SCRIPT_DIR}" +fi # Find fix-result.json in the output directory. # RUN_DIR is the original cwd (runDir = /), saved diff --git a/internal/scaffold/fullsend-repo/scripts/post-prioritize.sh b/internal/scaffold/fullsend-repo/scripts/post-prioritize.sh index d51140573..0c5ef645a 100755 --- a/internal/scaffold/fullsend-repo/scripts/post-prioritize.sh +++ b/internal/scaffold/fullsend-repo/scripts/post-prioritize.sh @@ -13,6 +13,14 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# When this script runs from a content-addressed cache path +# (sha256//content), companion files are not co-located. +# Fall back to ${FULLSEND_DIR}/scripts if the companion is missing. +# FULLSEND_DIR is required (fail-closed) to avoid silently resolving to cwd. +if [ ! -f "${SCRIPT_DIR}/lib/github-api-csma.sh" ] && [ -d "${FULLSEND_DIR:?FULLSEND_DIR must be set}/scripts/lib" ]; then + SCRIPT_DIR="${FULLSEND_DIR}/scripts" + echo "Using fallback companion path: ${SCRIPT_DIR}" +fi # shellcheck source=lib/github-api-csma.sh source "${SCRIPT_DIR}/lib/github-api-csma.sh"