Skip to content

Sync Element Web

Sync Element Web #10

name: Sync Element Web
on:
schedule:
- cron: "0 3 * * 1" # every Monday at 03:00 UTC
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
- name: Get latest release info
id: release
run: |
LATEST=$(curl -s https://api.github.com/repos/element-hq/element-web/releases/latest | jq -r '.tag_name')
echo "tag=$LATEST" >> $GITHUB_OUTPUT
echo "Latest release: $LATEST"
- name: Download release tarball
run: |
curl -L https://github.com/element-hq/element-web/archive/refs/tags/${{ steps.release.outputs.tag }}.tar.gz \
-o element-web.tar.gz
tar -xzf element-web.tar.gz
mv element-web-* upstream-release
- name: Run rename/move script
run: |
chmod +x ./scripts/rename.sh
mkdir -p ./processed
./scripts/rename.sh ./upstream-release ./processed
- name: Sync processed files
run: |
rsync -a --delete --exclude='.git' --exclude='.github' --exclude='scripts' ./processed/ ./
- name: Commit and push
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
# Only commit if there are changes
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Update to ${{ steps.release.outputs.tag }}"
git push origin main
else
echo "No changes to commit"
fi
- name: Notify via GitHub issue
uses: peter-evans/create-issue-from-file@v5
with:
title: "New Element Web release ${{ steps.release.outputs.tag }}"
content-filepath: ./processed/CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}