Skip to content

Commit ce01b34

Browse files
committed
fix(ci): wrong app version when update chart
1 parent 8e61ed1 commit ce01b34

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/release.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,12 @@ jobs:
155155
patch=$(echo "$version" | cut -d. -f3)
156156
new_chart_version="${major}.${minor}.$((patch + 1))"
157157
echo "New chart version is: $new_chart_version"
158+
# Calculate appVersion by removing 'v' prefix from VERSION
159+
new_app_version="${{ steps.get_version.outputs.VERSION }}"
160+
new_app_version="${new_app_version#v}"
161+
echo "New app version is: $new_app_version"
158162
echo "::set-output name=new_chart_version::$new_chart_version"
163+
echo "::set-output name=new_app_version::$new_app_version"
159164
160165
- name: Checkout Target repository
161166
uses: actions/checkout@v4
@@ -168,20 +173,20 @@ jobs:
168173
- name: Bump version in the related HelmChart Chart.yaml
169174
uses: fjogeleit/yaml-update-action@main
170175
env:
171-
COMMIT_MESSAGE: 'chore(karpor): bump app version to ${{ steps.get_version.outputs.VERSION }}, chart version to ${{ steps.get_chart_version.outputs.new_chart_version }}'
176+
COMMIT_MESSAGE: 'chore(karpor): bump app version to ${{ steps.get_chart_version.outputs.new_app_version }}, chart version to ${{ steps.get_chart_version.outputs.new_chart_version }}'
172177
with:
173178
repository: KusionStack/charts
174179
valueFile: 'charts/karpor/Chart.yaml'
175-
changes: '{"version":"${{ steps.get_chart_version.outputs.new_chart_version }}", "appVersion":"${{ steps.get_version.outputs.VERSION }}"}'
176-
value: ${{ steps.get_version.outputs.VERSION }}
177-
branch: bump-karpor-to-${{ steps.get_version.outputs.VERSION }}
180+
changes: '{"version":"${{ steps.get_chart_version.outputs.new_chart_version }}", "appVersion":"${{ steps.get_chart_version.outputs.new_app_version }}"}'
181+
value: ${{ steps.get_chart_version.outputs.new_app_version }}
182+
branch: bump-karpor-to-${{ steps.get_chart_version.outputs.new_app_version }}
178183
targetBranch: master
179184
message: ${{ env.COMMIT_MESSAGE }}
180185
createPR: true
181186
title: ${{ env.COMMIT_MESSAGE }}
182187
description: |
183188
This PR updates the Karpor Helm chart with the following changes:
184-
- Bump the `appVersion` to `${{ steps.get_version.outputs.VERSION }}`
189+
- Bump the `appVersion` to `${{ steps.get_chart_version.outputs.new_app_version }}`
185190
- Bump the `version` to `${{ steps.get_chart_version.outputs.new_chart_version }}`
186191
187192
These updates ensure that the chart reflects the latest Karpor release.
@@ -195,4 +200,4 @@ jobs:
195200
run: |
196201
echo "Testing complete. Check the logs for details."
197202
echo "New chart version: ${{ steps.get_chart_version.outputs.new_chart_version }}"
198-
echo "App version: ${{ steps.get_version.outputs.VERSION }}"
203+
echo "New app version: ${{ steps.get_chart_version.outputs.new_app_version }}"

0 commit comments

Comments
 (0)