Skip to content

Commit

Permalink
Sluggify branch name
Browse files Browse the repository at this point in the history
Otherwise the zip step fails on branches with "/" in it.
  • Loading branch information
spaceo committed Dec 11, 2023
1 parent e4af7c9 commit dda7e7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/create-release-on-branch-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dda7e7e

Please sign in to comment.