From 9564d073b911aa05e93673abddeb0a84b3dfac4c Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 1 Jun 2026 07:53:33 -0400 Subject: [PATCH] fix(ci): POSIX-safe SHORT_SHA in build.yml (runner uses dash, not bash) `${GITHUB_SHA:0:7}` substring expansion is bash-only; the runner executes the step via dash/BusyBox sh and errored with `Bad substitution` (act_runner workflow shell, observed on the 65386f0 main-push run). Switched to `SHORT_SHA=$(printf '%s' "$GITHUB_SHA" | cut -c1-7)` which works in both shells. Both build-web and build-ml tag-determination steps updated. --- .forgejo/workflows/build.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 861b15f..2d40117 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -258,7 +258,11 @@ jobs: # anything else → safety net; shouldn't fire given the `on:` # config above. Tag :dev to surface the # unexpected run in the registry. - SHORT_SHA="${GITHUB_SHA:0:7}" + # POSIX-safe substring (the runner shell is dash/BusyBox sh, not + # bash — `${var:0:7}` errors with "Bad substitution"; cut works + # everywhere). Operator-flagged 2026-06-01 after first :c- + # main-push build failed at this step. + SHORT_SHA=$(printf '%s' "$GITHUB_SHA" | cut -c1-7) if [ "${GITHUB_REF#refs/tags/}" != "${GITHUB_REF}" ]; then TAG_NAME="${GITHUB_REF#refs/tags/}" echo "tags=git.fabledsword.com/bvandeusen/fabledcurator:${TAG_NAME}" >> "$GITHUB_OUTPUT" @@ -297,7 +301,11 @@ jobs: # safety-net dev) including the per-commit :c- tag # on main-push per the family release-posture rule. The -ml # image follows the same release cadence as the web image. - SHORT_SHA="${GITHUB_SHA:0:7}" + # POSIX-safe substring (the runner shell is dash/BusyBox sh, not + # bash — `${var:0:7}` errors with "Bad substitution"; cut works + # everywhere). Operator-flagged 2026-06-01 after first :c- + # main-push build failed at this step. + SHORT_SHA=$(printf '%s' "$GITHUB_SHA" | cut -c1-7) if [ "${GITHUB_REF#refs/tags/}" != "${GITHUB_REF}" ]; then TAG_NAME="${GITHUB_REF#refs/tags/}" echo "tags=git.fabledsword.com/bvandeusen/fabledcurator-ml:${TAG_NAME}" >> "$GITHUB_OUTPUT"