From cd2ee4ee5f6cc0d6e2d5bdb5e8e8c9e35bd7a69b Mon Sep 17 00:00:00 2001 From: test Date: Sun, 19 Jul 2026 20:28:32 +0800 Subject: [PATCH] ci: add set -e and debug logging --- .gitea/workflows/build.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index e6c3d3d..30f9dea 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -71,19 +71,27 @@ jobs: - name: Update image tag in values.yaml (commit-back GitOps) run: | + set -e WORK=/root/.cache/demo-frontend cd $WORK SHORT=${GITHUB_SHA::8} + echo "Updating tag to ${SHORT}" # Use sed to update image.tag in helm values.yaml sed -i "s/^ tag:.*/ tag: \"${SHORT}\"/" deploy/helm/values.yaml - # Show the diff - git diff deploy/helm/values.yaml - # Commit and push + echo "--- diff ---" + git diff deploy/helm/values.yaml || true + # Configure git git config user.email "ci@local" git config user.name "gitea-ci" + # Check if there are changes + if git diff --quiet deploy/helm/values.yaml; then + echo "No changes to commit" + exit 0 + fi git add deploy/helm/values.yaml git commit -m "ci: update image tag to ${SHORT}" git push origin main + echo "✓ Pushed tag ${SHORT}" env: GITHUB_SHA: ${{ github.sha }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}