Skip to content

Commit 1034407

Browse files
committed
Replace slashes with dashes
1 parent 71e6bdc commit 1034407

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/publish-snapshot.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
workflow_dispatch:
66

7+
env:
8+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
9+
710
jobs:
811
publish-snapshot:
912
runs-on: ubuntu-24.04
@@ -30,9 +33,9 @@ jobs:
3033
- name: Generate snapshot version
3134
id: version
3235
run: |
33-
BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
3436
COMMIT_HASH=$(git rev-parse --short ${{ github.sha }})
35-
SNAPSHOT_VERSION="${BRANCH_NAME}+${COMMIT_HASH}"
37+
# Replace slashes in branch name with dashes for proper versioning
38+
SNAPSHOT_VERSION="${BRANCH_NAME//\//-}+${COMMIT_HASH}"
3639
echo "snapshot_version=${SNAPSHOT_VERSION}" >> $GITHUB_OUTPUT
3740
echo "Generated snapshot version: ${SNAPSHOT_VERSION}"
3841
echo "::notice title=Snapshot Version::${SNAPSHOT_VERSION}"
@@ -47,6 +50,6 @@ jobs:
4750
run: |
4851
echo "## 📦 Snapshot Published" >> $GITHUB_STEP_SUMMARY
4952
echo "**Version:** \`${{ steps.version.outputs.snapshot_version }}\`" >> $GITHUB_STEP_SUMMARY
50-
echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
53+
echo "**Branch:** \`${BRANCH_NAME}\`" >> $GITHUB_STEP_SUMMARY
5154
echo "**Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
5255
echo "**Repository:** GitHub Packages" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)