Skip to content

Commit 1cbca2c

Browse files
committed
fix(ci): push from release event too and handle multiple tags
we push latest and versioned tags here, need to handle that also run `release-please` after releasing to update the new PR again
1 parent f32aa88 commit 1cbca2c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
env:
4949
REGISTRY: ghcr.io
5050
IMAGE: grafana/generate-policy-bot-config
51-
PUSH_IMAGE: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || '' }}
51+
PUSH_IMAGE: ${{ (github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) || '' }}
5252

5353
steps:
5454
- name: Checkout
@@ -92,8 +92,12 @@ jobs:
9292
- name: Extract platform-specific digests
9393
if: env.PUSH_IMAGE
9494
id: platform-digests
95+
shell: bash
9596
run: |
96-
REGISTRY_REF="${{ steps.calculate-metadata.outputs.tags }}"
97+
declare -a TAGS
98+
TAGS=(${{ steps.calculate-metadata.outputs.tags }})
99+
100+
REGISTRY_REF="${TAGS[0]}"
97101
BASE_REF="${REGISTRY_REF%%:*}"
98102
99103
# Get digests for each platform

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ on:
33
branches:
44
- main
55

6+
release:
7+
types:
8+
- published
9+
610
permissions:
711
contents: write
812
pull-requests: write

0 commit comments

Comments
 (0)