From 02a8ed7854578e8b01f9da16e960b9d5605fca2c Mon Sep 17 00:00:00 2001 From: Andreea Lupu <58118008+Andreea-Lupu@users.noreply.github.com> Date: Fri, 24 Nov 2023 10:40:42 +0200 Subject: [PATCH] fix(ci): prevent spaces from being removed when helm chart is updated (#2078) - `yq` command removes the extra spaces before an end line comment so this will cause `helm lint` failure - by this change, the deleted spaces will be ignored and it will be kept only the new value of `.image.tag` Signed-off-by: Andreea-Lupu --- .github/workflows/publish.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index ad4d83e6..144f603f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -253,7 +253,13 @@ jobs: - name: Update image tag uses: mikefarah/yq@master with: - cmd: yq -i '.image.tag = "${{ github.event.release.tag_name }}"' 'helm-charts/charts/zot/values.yaml' + cmd: | + yq e '.image.tag = "${{ github.event.release.tag_name }}"' 'helm-charts/charts/zot/values.yaml' > values-updated.yaml + - name: Patch values.yaml file + run: | + diff -b 'helm-charts/charts/zot/values.yaml' values-updated.yaml > values.diff || true + patch 'helm-charts/charts/zot/values.yaml' < values.diff + rm values-updated.yaml values.diff - name: Update version run: | sudo apt-get install pip