Fix: release workflow pushes updates.xml to main automatically
Some checks failed
Repo Health / Access control (push) Successful in 1s
Repo Health / Release configuration (push) Failing after 3s
Repo Health / Scripts governance (push) Successful in 3s
Repo Health / Repository health (push) Failing after 3s

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) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-04-18 12:01:18 -05:00
parent 0208de8132
commit cc6d8e6b61

View File

@@ -367,19 +367,39 @@ jobs:
print(f"Updated {xml_tag} channel: version={version}, sha={sha256[:16]}..., date={date}") print(f"Updated {xml_tag} channel: version={version}, sha={sha256[:16]}..., date={date}")
PYEOF PYEOF
- name: "Commit updates.xml" - name: "Commit updates.xml to current branch and main"
run: | run: |
if git diff --quiet updates.xml 2>/dev/null; then if git diff --quiet updates.xml 2>/dev/null; then
echo "No changes to updates.xml" echo "No changes to updates.xml"
exit 0 exit 0
fi 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.email "gitea-actions[bot]@mokoconsulting.tech"
git config --local user.name "gitea-actions[bot]" git config --local user.name "gitea-actions[bot]"
git add updates.xml 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] <gitea-actions[bot]@mokoconsulting.tech>" --author="gitea-actions[bot] <gitea-actions[bot]@mokoconsulting.tech>"
# Push to current branch
git push || true 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] <gitea-actions[bot]@mokoconsulting.tech>" || true
git push origin main || true
git checkout "$CURRENT_BRANCH"
fi
- name: Summary - name: Summary
run: | run: |
VERSION="${{ steps.meta.outputs.version }}" VERSION="${{ steps.meta.outputs.version }}"