Fix staging slug trailing dash after cut
Django CI/CD / test (push) Failing after 5m10s
Staging deployment / deploy (push) Successful in 1m3s
Staging deployment / teardown (push) Has been skipped
Django CI/CD / build-and-push (push) Has been skipped

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 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 09:31:47 +02:00
parent 9d77fca009
commit beb1274c7f
+2 -2
View File
@@ -23,7 +23,7 @@ jobs:
- name: Compute staging name - name: Compute staging name
run: | 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}" APP="timetracker-staging-${SLUG}"
echo "SLUG=${SLUG}" >> "$GITHUB_ENV" echo "SLUG=${SLUG}" >> "$GITHUB_ENV"
echo "APP=${APP}" >> "$GITHUB_ENV" echo "APP=${APP}" >> "$GITHUB_ENV"
@@ -94,6 +94,6 @@ jobs:
- name: Destroy staging app - name: Destroy staging app
run: | 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}" APP="timetracker-staging-${SLUG}"
flyctl apps destroy "$APP" --yes 2>/dev/null || true flyctl apps destroy "$APP" --yes 2>/dev/null || true