From cc6d8e6b618ca60ad92c45f401835426cd2a5248 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 18 Apr 2026 12:01:18 -0500 Subject: [PATCH] Fix: release workflow pushes updates.xml to main automatically When running from a non-main branch (e.g. dev), the workflow now cherry-picks the updates.xml change to main so the Joomla update server always has the latest SHA and download URLs. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f43a165..971fe0d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -367,19 +367,39 @@ jobs: print(f"Updated {xml_tag} channel: version={version}, sha={sha256[:16]}..., date={date}") PYEOF - - name: "Commit updates.xml" + - name: "Commit updates.xml to current branch and main" run: | if git diff --quiet updates.xml 2>/dev/null; then echo "No changes to updates.xml" exit 0 fi + + STABILITY="${{ steps.meta.outputs.stability }}" + VERSION="${{ steps.meta.outputs.version }}" + CURRENT_BRANCH="${{ github.ref_name }}" + TOKEN="${{ secrets.GA_TOKEN }}" + git config --local user.email "gitea-actions[bot]@mokoconsulting.tech" git config --local user.name "gitea-actions[bot]" git add updates.xml - git commit -m "chore: update ${STABILITY} SHA-256 for ${{ steps.meta.outputs.version }} [skip ci]" \ + git commit -m "chore: update ${STABILITY} SHA-256 for ${VERSION} [skip ci]" \ --author="gitea-actions[bot] " + + # Push to current branch git push || true + # Also push updates.xml to main (where the update server reads from) + if [ "$CURRENT_BRANCH" != "main" ]; then + git fetch origin main + git checkout main + git checkout "$CURRENT_BRANCH" -- updates.xml + git add updates.xml + git commit -m "chore: update ${STABILITY} channel to ${VERSION} on main [skip ci]" \ + --author="gitea-actions[bot] " || true + git push origin main || true + git checkout "$CURRENT_BRANCH" + fi + - name: Summary run: | VERSION="${{ steps.meta.outputs.version }}"