From dda7e7e56c7523c6a3b2a2ad691e5054acb48c68 Mon Sep 17 00:00:00 2001 From: Mikkel Jakobsen Date: Mon, 11 Dec 2023 10:50:47 +0100 Subject: [PATCH] Sluggify branch name Otherwise the zip step fails on branches with "/" in it. --- .github/workflows/create-release-on-branch-changes.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-release-on-branch-changes.yml b/.github/workflows/create-release-on-branch-changes.yml index 7ff8a7bf50..68179cfff7 100644 --- a/.github/workflows/create-release-on-branch-changes.yml +++ b/.github/workflows/create-release-on-branch-changes.yml @@ -20,13 +20,14 @@ jobs: # development. run: | RELEASE_BRANCH=$(echo ${GITHUB_REF#refs/heads/}) + SLUGGED_BRANCH_NAME=$(echo $RELEASE_BRANCH | sed -E -e 's/[^[:alnum:]]+/-/g' -e 's/^-+|-+$//g' | tr '[:upper:]' '[:lower:]') RELEASE_SHA=${{ github.sha }} TAG_NAME=$(echo "branch-${RELEASE_BRANCH}") echo "RELEASE_BRANCH=$RELEASE_BRANCH" >> "$GITHUB_ENV" echo "RELEASE_SHA=$RELEASE_SHA" >> "$GITHUB_ENV" echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" echo "BUILD_VERSION=${RELEASE_BRANCH}-${RELEASE_SHA}" >> "$GITHUB_ENV" - echo "DIST_FILENAME=dist-$RELEASE_BRANCH.zip" >> "$GITHUB_ENV" + echo "DIST_FILENAME=dist-${SLUGGED_BRANCH_NAME}.zip" >> "$GITHUB_ENV" # Checkout the HEAD of the PR branch to get the latest commit message. - uses: actions/checkout@v4