Skip to content

Commit ba279f0

Browse files
committed
chore: add provenance and trigger on tag
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent c12d348 commit ba279f0

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
branches:
88
- main
99
- 'release/*'
10+
tags:
11+
- '*'
1012
workflow_dispatch:
1113

1214
env:
@@ -39,7 +41,14 @@ jobs:
3941
- name: Get package version
4042
id: package-version
4143
run: |
42-
VERSION=$(node -p "require('./package.json').version")
44+
# Use git tag if available (for tag-triggered builds), otherwise use package.json
45+
if [ -n "${{ github.ref_type }}" ] && [ "${{ github.ref_type }}" = "tag" ]; then
46+
# Remove 'v' prefix if present (e.g., v1.0.0 -> 1.0.0)
47+
VERSION="${{ github.ref_name }}"
48+
VERSION="${VERSION#v}"
49+
else
50+
VERSION=$(node -p "require('./package.json').version")
51+
fi
4352
echo "version=$VERSION" >> $GITHUB_OUTPUT
4453
echo "Package version: $VERSION"
4554
@@ -82,3 +91,5 @@ jobs:
8291
IMAGE_CREATED=${{ steps.image-meta.outputs.created }}
8392
cache-from: type=gha
8493
cache-to: type=gha,mode=max
94+
provenance: true
95+
sbom: true

0 commit comments

Comments
 (0)