|
1 | 1 | name: Sync libdebug gh-pages into main
|
2 |
| - |
3 | 2 | on:
|
4 | 3 | push:
|
5 |
| - branches: |
6 |
| - - main |
| 4 | + branches: [main] |
| 5 | + repository_dispatch: |
| 6 | + types: [refresh_rolling] |
7 | 7 |
|
8 | 8 | jobs:
|
9 | 9 | sync:
|
| 10 | + if: github.actor != 'github-actions[bot]' |
10 | 11 | runs-on: ubuntu-latest
|
11 |
| - permissions: |
12 |
| - contents: write |
| 12 | + permissions: { contents: write } |
13 | 13 |
|
14 | 14 | steps:
|
15 |
| - - name: Checkout this repo |
16 |
| - uses: actions/checkout@v4 |
17 |
| - with: |
18 |
| - fetch-depth: 0 |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + with: { fetch-depth: 0 } |
19 | 17 |
|
20 | 18 | - name: Checkout libdebug gh-pages
|
21 | 19 | uses: actions/checkout@v4
|
22 | 20 | with:
|
23 | 21 | repository: libdebug/libdebug
|
24 | 22 | ref: gh-pages
|
25 |
| - path: libdebug-pages |
| 23 | + path: /tmp/libdebug-pages |
26 | 24 | fetch-depth: 1
|
| 25 | + token: ${{ secrets.GITHUB_TOKEN }} |
27 | 26 |
|
28 |
| - - name: Sync files from gh-pages |
| 27 | + - name: Sync files |
29 | 28 | run: |
|
30 |
| - # copy all files over, but leave existing files intact and skip any .git dirs |
31 |
| - rsync -av libdebug-pages/ . \ |
32 |
| - --exclude '.github/**' \ |
33 |
| - --exclude '.git' \ |
34 |
| - --exclude '.git/**' |
| 29 | + rsync -av /tmp/libdebug-pages/ ./ \ |
| 30 | + --exclude '.git' --exclude '.github/**' --exclude 'CNAME' |
35 | 31 |
|
36 |
| - - name: Commit & push changes |
| 32 | + - name: Commit & push |
37 | 33 | env:
|
38 | 34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
39 | 35 | run: |
|
40 | 36 | git config user.name "github-actions[bot]"
|
41 | 37 | git config user.email "github-actions[bot]@users.noreply.github.com"
|
42 |
| -
|
43 | 38 | if git diff --quiet; then
|
44 | 39 | echo "✅ Nothing to commit."
|
45 | 40 | else
|
46 | 41 | git add --all
|
47 |
| - git commit -m "chore: sync content from libdebug/libdebug@gh-pages" |
48 |
| - git push origin main |
| 42 | + git commit -m "chore: sync content from libdebug@gh-pages" |
| 43 | + git push origin HEAD |
49 | 44 | fi
|
0 commit comments