Skip to content

Commit a9ca0ba

Browse files
Workflow: more stable version
1 parent ecef309 commit a9ca0ba

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/sync-element-web.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,52 @@ jobs:
99
sync:
1010
runs-on: ubuntu-latest
1111
steps:
12+
# Step 1: Checkout repo
1213
- name: Checkout repo
1314
uses: actions/checkout@v4
1415

16+
# Step 2: Get latest release tag from upstream
1517
- name: Get latest release info
1618
id: release
1719
run: |
1820
LATEST=$(curl -s https://api.github.com/repos/element-hq/element-web/releases/latest | jq -r '.tag_name')
1921
echo "tag=$LATEST" >> $GITHUB_OUTPUT
22+
echo "Latest release: $LATEST"
2023
24+
# Step 3: Download release
2125
- name: Download release tarball
2226
run: |
2327
curl -L https://github.com/element-hq/element-web/archive/refs/tags/${{ steps.release.outputs.tag }}.tar.gz \
2428
-o element-web.tar.gz
2529
tar -xzf element-web.tar.gz
2630
mv element-web-* upstream-release
2731
28-
- name: Run custom script
32+
# Step 4: Run custom script, output to stable folder
33+
- name: Run rename/move script
2934
run: |
3035
chmod +x ./scripts/rename.sh
36+
# Use processed as stable folder
3137
./scripts/rename.sh ./upstream-release ./processed
3238
33-
- name: Commit and push changes
39+
# Step 5: Sync processed files into repo root safely
40+
- name: Sync processed files
41+
run: |
42+
rsync -a --delete --exclude='.github' --exclude='scripts' ./processed/ ./
43+
44+
# Step 6: Commit and push changes
45+
- name: Commit and push
3446
run: |
35-
mkdir temp-sync
36-
rsync -a --exclude='.github' --exclude='scripts' ./processed/ ./temp-sync/
37-
rsync -a --delete ./temp-sync/ ./
38-
rm -rf temp-sync
3947
git config user.name "github-actions"
4048
git config user.email "[email protected]"
4149
git add .
4250
git commit -m "Update to ${{ steps.release.outputs.tag }}" || echo "No changes to commit"
4351
git push origin main
4452
45-
- name: Notify via issue
53+
# Step 7: Notify via issue
54+
- name: Notify via GitHub issue
4655
uses: peter-evans/create-issue-from-file@v5
4756
with:
4857
title: "New Element Web release ${{ steps.release.outputs.tag }}"
4958
content-filepath: ./processed/CHANGELOG.md
5059
token: ${{ secrets.GITHUB_TOKEN }}
60+

0 commit comments

Comments
 (0)