From beb1274c7f52298167ea0c9ce22870ac40e997c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Mon, 15 Jun 2026 09:31:47 +0200 Subject: [PATCH] Fix staging slug trailing dash after cut Branch names that hit the 30-char cut boundary can end with a dash, which Fly.io rejects. Strip trailing dashes after cut in both deploy and teardown jobs. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/staging.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index e3e4fcd..e4486be 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -23,7 +23,7 @@ jobs: - name: Compute staging name run: | - SLUG=$(echo "$BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/-+/-/g; s/^-//; s/-$//' | cut -c1-30) + SLUG=$(echo "$BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/-+/-/g; s/^-//; s/-$//' | cut -c1-30 | sed 's/-*$//') APP="timetracker-staging-${SLUG}" echo "SLUG=${SLUG}" >> "$GITHUB_ENV" echo "APP=${APP}" >> "$GITHUB_ENV" @@ -94,6 +94,6 @@ jobs: - name: Destroy staging app run: | - SLUG=$(echo "$BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/-+/-/g; s/^-//; s/-$//' | cut -c1-30) + SLUG=$(echo "$BRANCH" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9-]+/-/g; s/-+/-/g; s/^-//; s/-$//' | cut -c1-30 | sed 's/-*$//') APP="timetracker-staging-${SLUG}" flyctl apps destroy "$APP" --yes 2>/dev/null || true