Skip to content

Commit 02a8ed7

Browse files
authored
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 <[email protected]>
1 parent 6222dae commit 02a8ed7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/publish.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,13 @@ jobs:
253253
- name: Update image tag
254254
uses: mikefarah/yq@master
255255
with:
256-
cmd: yq -i '.image.tag = "${{ github.event.release.tag_name }}"' 'helm-charts/charts/zot/values.yaml'
256+
cmd: |
257+
yq e '.image.tag = "${{ github.event.release.tag_name }}"' 'helm-charts/charts/zot/values.yaml' > values-updated.yaml
258+
- name: Patch values.yaml file
259+
run: |
260+
diff -b 'helm-charts/charts/zot/values.yaml' values-updated.yaml > values.diff || true
261+
patch 'helm-charts/charts/zot/values.yaml' < values.diff
262+
rm values-updated.yaml values.diff
257263
- name: Update version
258264
run: |
259265
sudo apt-get install pip

0 commit comments

Comments
 (0)