Skip to content

Commit 8e3cc3c

Browse files
committed
chore: suffix -dev for non release images
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent f70126e commit 8e3cc3c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/push-to-registry.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@ jobs:
4141
- name: Get package version
4242
id: package-version
4343
run: |
44-
# Use git tag if available (for tag-triggered builds), otherwise use package.json
44+
# Use git tag if available (for tag-triggered builds), otherwise use base version with -dev suffix
4545
if [ -n "${{ github.ref_type }}" ] && [ "${{ github.ref_type }}" = "tag" ]; then
4646
# Remove 'v' prefix if present (e.g., v1.0.0 -> 1.0.0)
4747
VERSION="${{ github.ref_name }}"
4848
VERSION="${VERSION#v}"
4949
else
50-
VERSION=$(node -p "require('./package.json').version")
50+
# For branch pushes (like main), use base version with -dev suffix
51+
BASE_VERSION=$(node -p "require('./package.json').version" | sed -E 's/-ea[.-][0-9]+$//')
52+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
53+
VERSION="${BASE_VERSION}-dev"
54+
else
55+
VERSION="$BASE_VERSION"
56+
fi
5157
fi
5258
echo "version=$VERSION" >> $GITHUB_OUTPUT
5359
echo "Package version: $VERSION"

0 commit comments

Comments
 (0)