From da787921dc3e286ec07e9acde140d7a71b928d7e Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 19 Jul 2026 20:48:18 +0800 Subject: [PATCH] ci: add debug logging --- .gitea/workflows/build.yml | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 7c5af00..82f1dac 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -44,28 +44,25 @@ jobs: - name: Update image tag in values.yaml (commit-back GitOps) run: | - set -e + set -ex WORK=/root/.cache/demo-go-api cd $WORK SHORT=${GITHUB_SHA::8} - echo "Updating tag to ${SHORT}" - # Set up git auth using token - git remote set-url origin "http://joe:${GITEA_TOKEN}@192.168.1.212:3000/joe/demo-go-api.git" - git config user.email "ci@local" - git config user.name "gitea-ci" + echo "=== Updating tag to ${SHORT} ===" + pwd + ls -la + cat deploy/helm/values.yaml + git status + git remote -v # Update tag in values.yaml sed -i "s/^ tag:.*/ tag: \"${SHORT}\"/" deploy/helm/values.yaml - echo "--- diff ---" - git diff deploy/helm/values.yaml || true - # Check if there are changes - if git diff --quiet deploy/helm/values.yaml; then - echo "No changes to commit" - exit 0 - fi - # Pull latest to avoid conflicts - git pull --rebase origin main || git pull origin main --rebase + echo "--- after sed ---" + cat deploy/helm/values.yaml + git config user.email "ci@local" + git config user.name "gitea-ci" + git remote set-url origin "http://joe:${GITEA_TOKEN}@192.168.1.212:3000/joe/demo-go-api.git" git add deploy/helm/values.yaml - git commit -m "ci: update image tag to ${SHORT}" + git commit -m "ci: update image tag to ${SHORT}" || echo "nothing to commit" git push origin main echo "✓ Pushed tag ${SHORT}" env: