From d4b6457b06c90be0fcfe46962537334011911618 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Mon, 17 Aug 2026 11:18:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20restore=20step=20died=20with=20exit=2014?= =?UTF-8?q?1=20(SIGPIPE)=20on=20every=20cache=20hit=20=E2=80=94=20act=20ru?= =?UTF-8?q?ns=20step=20scripts=20with=20'bash=20-e=20-o=20pipefail',=20so?= =?UTF-8?q?=20the=20'FIRST=5FENTRY=3D$(tar=20-tf=20...=20|=20head=20-1)'?= =?UTF-8?q?=20detection=20line=20killed=20the=20step:=20head=20-1=20closes?= =?UTF-8?q?=20the=20pipe=20after=20the=20first=20line,=20tar=20gets=20SIGP?= =?UTF-8?q?IPE=20(141),=20and=20pipefail=20propagates=20it=20as=20the=20sc?= =?UTF-8?q?ript=20exit=20status=20(observed:=20'Cache=20hit'=20then=20'Pro?= =?UTF-8?q?cess=20completed=20with=20exit=20code=20141',=20step=20duration?= =?UTF-8?q?=200s,=20on=20deploy-leptos=20after=20this=20detection=20line?= =?UTF-8?q?=20was=20added=20on=202026-08-14)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous restores predate the detection line, which is why this only started failing on 2026-08-17. Suppress the pipeline status with '|| true' — FIRST_ENTRY still captures the first archive entry, and a genuinely unreadable archive degrades to the legacy fallback / cache-hit=false path as before. --- action.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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