From 2d644a1ec3d26f0bf791c8818ee23b7aad58aeca Mon Sep 17 00:00:00 2001 From: Raul Costa Date: Thu, 2 Apr 2026 01:18:16 +0100 Subject: [PATCH] RC: (debug) workflow not pushing to chart --- .gitea/workflows/deploy.yaml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 9325e19..f16b30b 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -49,19 +49,28 @@ jobs: - name: Update Helm values.yaml for Flux run: | - # Go into the downloaded infrastructure repo cd infra-workspace - # 1. Update the image tag in your local Helm chart using sed + echo "--- TARGET FILE BEFORE ---" + cat charts/slashroot/values.yaml + + # The sed command (Make sure the path matches perfectly!) sed -i "s/tag: .*/tag: ${{ gitea.sha }}/g" charts/slashroot/values.yaml - # 2. Configure the Gitea Bot to commit the change + echo "--- TARGET FILE AFTER ---" + cat charts/slashroot/values.yaml + + # Set up Git git config user.name "Gitea Actions Bot" git config user.email "actions@gitea.local" + git add charts/slashroot/values.yaml - # Commit and Push back to the Infra Repo - git add . - git commit -m "BOT: (bump) slashroot-cc update: ${{ gitea.sha }}" - - # Push the changes (The token we provided earlier handles authentication) - git push origin main + # Check if there are actually changes to commit + if git diff --staged --quiet; then + echo "❌ ERROR: No changes were made! Check if 'tag: ' actually exists in your values.yaml" + exit 1 + else + echo "✅ Changes detected! Committing and pushing..." + git commit -m "chore: deploy slashroot-cc update ${{ gitea.sha }} [skip ci]" + git push origin main + fi