Skip to content

Commit e9544d6

Browse files
committed
chore: use commit sha for image tagging
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
1 parent ac388b9 commit e9544d6

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
name: Push to registry
44

55
on:
6-
push:
6+
workflow_run:
7+
workflows: ["Integration Tests"]
8+
types:
9+
- completed
710
branches:
811
- main
9-
- 'release/*'
12+
push:
1013
tags:
11-
- '*'
14+
- 'v*.*.*'
15+
- '*.*.*'
1216
workflow_dispatch:
1317

1418
env:
@@ -17,6 +21,10 @@ env:
1721

1822
jobs:
1923
build-and-push:
24+
if: |
25+
github.event_name == 'workflow_run' &&
26+
github.event.workflow_run.head_branch == 'main' &&
27+
github.event.workflow_run.event == 'push'
2028
runs-on: ubuntu-latest
2129
permissions:
2230
contents: read
@@ -50,8 +58,8 @@ jobs:
5058
# For branch pushes (like main), use base version with -dev suffix and commit SHA
5159
BASE_VERSION=$(node -p "require('./package.json').version" | sed -E 's/-ea[.-][0-9]+$//')
5260
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
53-
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
54-
VERSION="${BASE_VERSION}-ea-${SHORT_SHA}"
61+
SHORT_SHA=$(git rev-parse --short "${{ github.sha }}")
62+
VERSION="${BASE_VERSION}-ea.${SHORT_SHA}"
5563
else
5664
VERSION="$BASE_VERSION"
5765
fi

0 commit comments

Comments
 (0)