Skip to content

Commit e5b906f

Browse files
Update kustomize-ci workflow to configure git credentials and update image tag in dev overlay
1 parent 01ed870 commit e5b906f

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

.github/workflows/kustomize-ci.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ jobs:
7171
- name: Checkout code
7272
uses: actions/checkout@v4
7373

74+
- name: Configure git
75+
run: |
76+
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
77+
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
78+
7479
- name: Update image tag in dev overlay
7580
run: |
7681
FILE="kustomize/overlays/dev/patch-deployment-image.yaml"
@@ -79,16 +84,20 @@ jobs:
7984
8085
sed -i.bak -E "s|image:.*|image: ${IMAGE_NAME}:${IMAGE_TAG}|" "$FILE"
8186
82-
- name: Commit and push changes
83-
run: |
84-
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
85-
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
87+
git add "$FILE"
88+
git commit -m "Update image tag to $IMAGE_TAG in kustomize overlay"
89+
git push origin HEAD:feature/kustomize-update
90+
91+
# - name: Commit and push changes
92+
# run: |
93+
# git config --global user.name "${{ secrets.GIT_USER_NAME }}"
94+
# git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
8695

8796

88-
git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git
97+
# git remote set-url origin https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }}.git
8998

90-
git add kustomize/overlays/dev/patch-deployment-image.yaml
91-
git commit -m "Update latest image tag to $IMAGE_TAG" || echo "No changes to commit"
92-
git push
93-
env:
94-
IMAGE_TAG: ${{ github.sha }}
99+
# git add kustomize/overlays/dev/patch-deployment-image.yaml
100+
# git commit -m "Update latest image tag to $IMAGE_TAG" || echo "No changes to commit"
101+
# git push
102+
# env:
103+
# IMAGE_TAG: ${{ github.sha }}

0 commit comments

Comments
 (0)