Skip to content

Commit 88432ee

Browse files
authored
Update release.yaml
1 parent a179429 commit 88432ee

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/release.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,39 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22+
2223
- name: Configure Git
2324
run: |
2425
git config user.name "$GITHUB_ACTOR"
2526
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
2627
28+
- name: Install yq
29+
uses: mikefarah/yq@e4902167197fa3543d2c67667822642edbe2d630 # v4.41.1
30+
31+
- name: Override Chart Version
32+
id: override_version
33+
if: startsWith(github.ref, 'refs/heads/release/')
34+
run: |
35+
CHART_PATH="charts/konnector/Chart.yaml"
36+
37+
# 1. Get the base version from Chart.yaml
38+
BASE_VERSION=$(yq '.version' $CHART_PATH)
39+
40+
# 2. Construct the pre-release version: <BASE_VERSION>-rc.<SHORT_SHA>
41+
# We use a short 7-character SHA for simplicity and uniqueness.
42+
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
43+
NEW_VERSION="${BASE_VERSION}-rc.${SHORT_SHA}"
44+
45+
echo "Original Chart Version: $BASE_VERSION"
46+
echo "New Pre-release Version: $NEW_VERSION"
47+
48+
# 3. Update the version in Chart.yaml using yq
49+
yq -i ".version = \"$NEW_VERSION\"" $CHART_PATH
50+
51+
echo "--- Updated Chart.yaml ---"
52+
cat $CHART_PATH
53+
echo "--------------------------"
54+
2755
- name: Install Helm
2856
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
2957
with:

0 commit comments

Comments
 (0)