|
9 | 9 | sync: |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | steps: |
12 | | - # Step 1: Checkout repo |
13 | 12 | - name: Checkout repo |
14 | 13 | uses: actions/checkout@v4 |
| 14 | + with: |
| 15 | + fetch-depth: 0 # ensures full history for commits |
15 | 16 |
|
16 | | - # Step 2: Get latest release tag from upstream |
17 | 17 | - name: Get latest release info |
18 | 18 | id: release |
19 | 19 | run: | |
20 | 20 | LATEST=$(curl -s https://api.github.com/repos/element-hq/element-web/releases/latest | jq -r '.tag_name') |
21 | 21 | echo "tag=$LATEST" >> $GITHUB_OUTPUT |
22 | 22 | echo "Latest release: $LATEST" |
23 | 23 |
|
24 | | - # Step 3: Download release |
25 | 24 | - name: Download release tarball |
26 | 25 | run: | |
27 | 26 | curl -L https://github.com/element-hq/element-web/archive/refs/tags/${{ steps.release.outputs.tag }}.tar.gz \ |
28 | 27 | -o element-web.tar.gz |
29 | 28 | tar -xzf element-web.tar.gz |
30 | 29 | mv element-web-* upstream-release |
31 | 30 |
|
32 | | - # Step 4: Run custom script, output to stable folder |
33 | 31 | - name: Run rename/move script |
34 | 32 | run: | |
35 | 33 | chmod +x ./scripts/rename.sh |
36 | 34 | # Make sure the folder exists |
37 | 35 | mkdir -p ./processed |
38 | 36 | ./scripts/rename.sh ./upstream-release ./processed |
39 | 37 |
|
40 | | - # Step 5: Sync processed files into repo root safely |
41 | 38 | - name: Sync processed files |
42 | 39 | run: | |
43 | 40 | rsync -a --delete --exclude='.github' --exclude='scripts' ./processed/ ./ |
44 | 41 |
|
45 | | - # Step 6: Commit and push changes |
46 | 42 | - name: Commit and push |
47 | 43 | run: | |
48 | 44 | git config user.name "github-actions" |
|
51 | 47 | git commit -m "Update to ${{ steps.release.outputs.tag }}" || echo "No changes to commit" |
52 | 48 | git push origin main |
53 | 49 |
|
54 | | - # Step 7: Notify via issue |
55 | 50 | - name: Notify via GitHub issue |
56 | 51 | uses: peter-evans/create-issue-from-file@v5 |
57 | 52 | with: |
|
0 commit comments