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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user