From c4099a150fea48e7745fa161f0b8760bd956f7bd Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Mon, 11 May 2026 21:22:49 +0000 Subject: [PATCH] chore: sync pre-release.yml from Template-Joomla [skip ci] --- .gitea/workflows/pre-release.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/pre-release.yml b/.gitea/workflows/pre-release.yml index 49693834..30c9bcfe 100644 --- a/.gitea/workflows/pre-release.yml +++ b/.gitea/workflows/pre-release.yml @@ -278,7 +278,7 @@ jobs: f.write(content) PYEOF - # Commit and push + # Commit and push to current branch if ! git diff --quiet updates.xml 2>/dev/null; then git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" git config --local user.name "gitea-actions[bot]" @@ -287,6 +287,28 @@ jobs: git push origin HEAD 2>&1 || echo "WARNING: push failed" fi + - name: "Sync updates.xml to all branches" + run: | + CURRENT_BRANCH="${{ github.ref_name }}" + git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" + git config --local user.name "gitea-actions[bot]" + + # Sync updates.xml to main and dev (whichever isn't current) + for BRANCH in main dev; do + [ "$BRANCH" = "$CURRENT_BRANCH" ] && continue + + echo "Syncing updates.xml → ${BRANCH}" + git fetch origin "${BRANCH}" 2>/dev/null || continue + git checkout "origin/${BRANCH}" -- . 2>/dev/null || continue + git checkout "${CURRENT_BRANCH}" -- updates.xml + if ! git diff --quiet updates.xml 2>/dev/null; then + git add updates.xml + git commit -m "chore: sync updates.xml from ${CURRENT_BRANCH} [skip ci]" + git push origin HEAD:refs/heads/${BRANCH} 2>&1 || echo "WARNING: push to ${BRANCH} failed" + fi + git checkout "${CURRENT_BRANCH}" 2>/dev/null + done + - name: "Delete lesser pre-release channels (cascade)" continue-on-error: true run: |