Skip to content

Commit 1e7d047

Browse files
committed
ACM: Update version on version bumps
For upstream that doesn't have version files, and were we added them ourselves, we want to update the version file to match the tag we actually upprade to. Also remove custom version parsing from KSM again as this was the root casue of the failure. Signed-off-by: Jacob Baungard Hansen <[email protected]>
1 parent bf05e59 commit 1e7d047

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/merge-acm-flow.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,18 @@ jobs:
170170
- name: Continue after merge conflict
171171
if: ${{ steps.merge.outputs.MERGE_CONFLICT == 'true' }}
172172
run: git merge --continue
173-
- name: Add VERSION file if not present
173+
- name: Add or update VERSION file
174174
run: |
175175
# All tags use the vX.Y.Z format currently.
176176
version_from_tag=$(echo ${{ steps.upstream.outputs.release }} | sed -e "s/^v//")
177177
if [ -f VERSION ]; then
178178
version_from_file=$(cat VERSION)
179179
if [ "$version_from_tag" != "$version_from_file" ];then
180-
echo "::error:: tag version ${version_from_tag} doesn't correspond to version ${version_from_file} from VERSION file"
181-
exit 1
180+
echo "Updating version file to ${version_from_tag}"
181+
echo "$version_from_tag" > VERSION
182+
git add VERSION
183+
git diff --cached --exit-code || git commit -s -m "[bot] update VERSION file with ${version_from_tag}"
184+
exit 0
182185
fi
183186
echo "::notice::VERSION file already present"
184187
exit 0

.github/workflows/merge-acm-kube-state-metrics.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ jobs:
2727
restore-downstream: >-
2828
OWNERS
2929
docs
30-
downstream-version-expression: |
31-
sed -n -E '1 s/^[^0-9]*(([0-9]+\.)*[0-9]+).*$/v\1/p' https://raw.githubusercontent.com/stolostron/kube-state-metrics/refs/heads/${{ inputs.downstream-branch }}/CHANGELOG.md
3230
secrets:
3331
pr-app-id: ${{ secrets.ACM_APP_ID }}
3432
pr-app-private-key: ${{ secrets.ACM_APP_PRIVATE_KEY }}

0 commit comments

Comments
 (0)