diff --git a/automation/cloudflared-sync.sh b/automation/cloudflared-sync.sh index 3dcf23f..41c81ce 100644 --- a/automation/cloudflared-sync.sh +++ b/automation/cloudflared-sync.sh @@ -88,9 +88,19 @@ echo "✅ Final merged values.yaml:" cat "$MERGED_FILE" # === STEP 5: Optional push to Git === -# cd "$INFRA_CLONE" -# git config user.name "woodpecker-bot" -# git config user.email "ci@dvirlabs.com" -# git add manifests/cloudflared/values.yaml -# git commit -m "chore(cloudflared): auto-add ingress from sandbox" -# git push +echo "📤 Pushing updated values.yaml to infra repo..." + +cd "$INFRA_CLONE" +git config user.name "woodpecker-bot" +git config user.email "ci@dvirlabs.com" + +# Only commit if there are changes +if ! git diff --quiet manifests/cloudflared/values.yaml; then + git add manifests/cloudflared/values.yaml + git commit -m "chore(cloudflared): auto-merge CNAME entries from sandbox" + git push origin HEAD + echo "✅ Changes pushed successfully." +else + echo "â„šī¸ No changes to commit." +fi +