Skip to content

Commit b8847fc

Browse files
authored
chore: fix the workflow trigger on release (#357)
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
1 parent cee0368 commit b8847fc

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/helm.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
name: Helm
22

33
on:
4+
release:
5+
types: [published]
46
push:
57
branches:
68
- main
79
tags:
810
- "v*"
911
pull_request:
10-
workflow_dispatch: {}
12+
workflow_dispatch:
13+
inputs:
14+
version:
15+
description: "Chart version to release (overrides Chart.yaml). Leave empty to use Chart.yaml."
16+
required: false
17+
type: string
1118

1219
permissions:
1320
contents: read
@@ -77,7 +84,7 @@ jobs:
7784

7885
release:
7986
needs: lint-and-test
80-
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
87+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' || github.event_name == 'release'
8188
permissions:
8289
contents: read
8390
packages: write
@@ -114,8 +121,14 @@ jobs:
114121

115122
- name: Package chart
116123
id: package_chart
124+
env:
125+
VERSION_INPUT: ${{ inputs.version }}
117126
run: |
118-
helm package deploy/charts/reloader --destination .helm-packages
127+
version_arg=()
128+
if [[ -n "${VERSION_INPUT}" ]]; then
129+
version_arg=(--version "${VERSION_INPUT}")
130+
fi
131+
helm package deploy/charts/reloader --destination .helm-packages "${version_arg[@]}"
119132
echo "pkg=$(echo .helm-packages/*.tgz)" >> "$GITHUB_OUTPUT"
120133
121134
- name: Push chart to GHCR

0 commit comments

Comments
 (0)