Skip to content

Commit 71e6bdc

Browse files
committed
Publish snapshot on every push, change pattern to 'BRANCH+COMMIT'
1 parent 434d6cd commit 71e6bdc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

.github/workflows/publish-snapshot.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Publish to GitHub packages
22

33
on:
44
push:
5-
branches:
6-
- neo
75
workflow_dispatch:
86

97
jobs:
@@ -32,9 +30,9 @@ jobs:
3230
- name: Generate snapshot version
3331
id: version
3432
run: |
35-
DATE=$(date +'%Y%m%d')
36-
COMMIT_HASH=$(git rev-parse --short HEAD)
37-
SNAPSHOT_VERSION="${DATE}+${COMMIT_HASH}"
33+
BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
34+
COMMIT_HASH=$(git rev-parse --short ${{ github.sha }})
35+
SNAPSHOT_VERSION="${BRANCH_NAME}+${COMMIT_HASH}"
3836
echo "snapshot_version=${SNAPSHOT_VERSION}" >> $GITHUB_OUTPUT
3937
echo "Generated snapshot version: ${SNAPSHOT_VERSION}"
4038
echo "::notice title=Snapshot Version::${SNAPSHOT_VERSION}"

0 commit comments

Comments
 (0)