-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (35 loc) · 1 KB
/
Copy pathwiki.yml
File metadata and controls
39 lines (35 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Sync wiki/ to GitHub Wiki
##
on:
push:
branches: [gh-wiki]
paths:
- wiki/**
- .github/workflows/sync-wiki.yml
jobs:
sync-wiki:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: wiki
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
path: main-repo
- uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
path: wiki-repo
- run: |
rsync -av --delete --exclude='.git' main-repo/wiki/ wiki-repo/
cd wiki-repo
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add .
git diff --cached --quiet || git commit -m "Sync wiki"
git push
# Logs showed that rsync --delete is wiping the .git/ folder...
# out of wiki-repo before we cd into it, so when we run git add .
# there's no git repo left. The fixed code above should work now.