Skip to content

Commit e9ce964

Browse files
committed
fix: gh action tag env overriding actual tag while push from main
Previously it used IMAGE_TAG for both source and target tags when tagging for push latest commit to main. This will add a new ENV to set the TARGET_TAG. Fixes aipcc-cicd#19. Signed-off-by: Adrian Riobo <ariobolo@redhat.com>
1 parent f0e510c commit e9ce964

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ jobs:
6262
make oci-manifest-push
6363
6464
- name: Tag as latest (main branch only)
65-
if: github.ref == 'refs/heads/main'
65+
if: github.event_name == 'push'
6666
run: |
6767
make oci-tag
6868
make oci-push
6969
env:
70-
IMAGE_TAG: latest
70+
IMAGE_TARGET_TAG: latest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ oci-manifest-push:
3939
${CONTAINER_MANAGER} manifest push $(IMAGE_NAME)
4040

4141
oci-tag:
42-
${CONTAINER_MANAGER} tag $(IMAGE_NAME) $(IMAGE_REPO):$(IMAGE_TAG)
42+
${CONTAINER_MANAGER} tag $(IMAGE_NAME) $(IMAGE_REPO):$(IMAGE_TARGET_TAG)
4343

4444
oci-push:
4545
${CONTAINER_MANAGER} push $(IMAGE_NAME)

0 commit comments

Comments
 (0)