Skip to content

Commit ced6310

Browse files
authored
Merge pull request #279 from Anton-Fil/main
fix: trigger release-helm-chart also on push tags and validation
2 parents 8856aae + b36c837 commit ced6310

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/release-helm-chart.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
release:
77
types:
88
- published
9+
push:
10+
tags:
11+
- "v*.*.*"
912
workflow_dispatch:
1013
inputs:
1114
operatorTag:
@@ -19,6 +22,19 @@ jobs:
1922
contents: write
2023

2124
steps:
25+
- name: Validate semver tag
26+
id: validate
27+
if: github.event_name == 'push'
28+
run: |
29+
TAG="${{ github.ref }}"
30+
if [[ "$TAG" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
31+
echo "Valid semver tag: $TAG"
32+
else
33+
echo "::error::Invalid semver tag: $TAG"
34+
echo "Expected a valid SemVer (https://semver.org/) format, i.e.: v1.2.3, v1.2.3-alpha1, v1.2.3-dev"
35+
exit 1
36+
fi
37+
2238
- name: Checkout
2339
uses: actions/checkout@v4
2440
with:
@@ -39,7 +55,7 @@ jobs:
3955
4056
- name: Parse Tag
4157
run: |
42-
tag=${{ github.event.release.tag_name || inputs.operatorTag }}
58+
tag=${{ github.event.release.tag_name || github.ref_name || inputs.operatorTag }}
4359
echo "OPERATOR_VERSION=${tag#v}" >> $GITHUB_ENV
4460
echo "OPERATOR_TAG=${tag}" >> $GITHUB_ENV
4561

0 commit comments

Comments
 (0)