From 8b2e1275afbead8297890c16042f4d1c9951a2b3 Mon Sep 17 00:00:00 2001 From: ilkermanap Date: Fri, 4 Sep 2026 22:36:47 +0200 Subject: [PATCH] Do not delete the workspace from inside it The checkout step ran rm -rf on $GITHUB_WORKSPACE while the shell's working directory was that same path. git then failed with 'Unable to read current working directory', and every later step died with 'fork/exec /usr/bin/bash: no such file or directory' for the same reason. Both the checkout and the cleanup step now cd to / first. Co-Authored-By: Claude Opus 5 (1M context) --- .gitea/workflows/build-image.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index 800afd2..502c233 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -44,6 +44,10 @@ jobs: # and has no Node.js runtime for JavaScript actions. run: | set -eux + # Step out of the workspace before removing it: the shell starts *in* + # $GITHUB_WORKSPACE, and deleting the current working directory makes + # every later command fail with "Unable to read current working directory". + cd / rm -rf "$GITHUB_WORKSPACE" git clone --depth 1 --branch "$GITHUB_REF_NAME" \ "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" "$GITHUB_WORKSPACE" @@ -120,5 +124,7 @@ jobs: if: always() run: | # A 1.5 GB artifact per run would fill the builder otherwise. + # Runs even when an earlier step left the workspace missing, so cd out first. + cd / rm -rf "$GITHUB_WORKSPACE/dist" "$GITHUB_WORKSPACE/build" || true df -h / | tail -1