File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070 update-helm :
7171 needs : build
7272 runs-on : self-hosted
73-
73+
7474 steps :
7575 - name : Checkout Helm Charts
7676 uses : actions/checkout@v3
@@ -83,15 +83,11 @@ jobs:
8383 - name : Ensure main branch is up to date
8484 run : git pull origin main
8585
86- - name : Install yq
87- run : |
88- sudo apt-get update -y
89- sudo apt-get install -y yq
90-
91- - name : Update image tag
86+ - name : Update image tag using sed
9287 run : |
9388 echo "Updating image tag to $IMAGE_TAG..."
94- yq w -i ./helm/application/values.yaml 'app.image.tag' "$IMAGE_TAG"
89+ # Using sed - universal and reliable
90+ sed -i 's/^\([[:space:]]*tag:[[:space:]]*\).*/\1'"$IMAGE_TAG"'/' ./helm/application/values.yaml
9591 echo "Updated Helm values.yaml:"
9692 cat ./helm/application/values.yaml
9793 env :
10197 run : |
10298 git add ./helm/application/values.yaml
10399 git commit -m "Update Flask App image tag to $IMAGE_TAG" || echo "No changes to commit"
104- git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git main
100+ git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git main
You can’t perform that action at this time.
0 commit comments