diff --git a/action.yaml b/action.yaml index 2b36d43..f485bf7 100644 --- a/action.yaml +++ b/action.yaml @@ -45,7 +45,12 @@ runs: # path. Legacy archives embed the absolute path of the run that # saved them; fall back to extracting them to "/" (status quo, # they are TTL-pruned within the retention window anyway). - FIRST_ENTRY=$(tar -tf "$ARCHIVE" 2>/dev/null | head -1) + # NOTE: `|| true` is mandatory — act runs step scripts with + # `bash -e -o pipefail`, and `head -1` closes the pipe after the + # first line, so tar dies with SIGPIPE (141) and pipefail turns + # that into a step failure (restore only ever "worked" before + # this detection line existed). + FIRST_ENTRY=$(tar -tf "$ARCHIVE" 2>/dev/null | head -1 || true) if [ "${FIRST_ENTRY%%/*}" = "$(basename "$EXPANDED_PATH")" ]; then echo "Restoring to: $(dirname "$EXPANDED_PATH")" tar -xf "$ARCHIVE" -C "$(dirname "$EXPANDED_PATH")" 2>/dev/null