File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Sync wiki
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ paths :
8+ - wiki/**
9+ workflow_dispatch :
10+
11+ jobs :
12+ sync :
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : write
16+
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@v4
20+
21+ - name : Checkout wiki repository
22+ uses : actions/checkout@v4
23+ with :
24+ repository : ${{ github.repository }}.wiki
25+ token : ${{ github.token }}
26+ path : wiki-repo
27+
28+ - name : Push wiki folder to GitHub Wiki
29+ run : |
30+ git -C wiki-repo config user.name "github-actions[bot]"
31+ git -C wiki-repo config user.email "github-actions[bot]@users.noreply.github.com"
32+
33+ # Copy wiki files while preserving the cloned repository metadata
34+ rsync -av --delete \
35+ --exclude=".git/" \
36+ --exclude="WIKI_SETUP.md" \
37+ wiki/ wiki-repo/
38+
39+ cd wiki-repo
40+
41+ git add -A
42+
43+ if git diff --cached --quiet; then
44+ echo "No wiki changes to commit."
45+ exit 0
46+ fi
47+
48+ git commit -m "Sync wiki from main repo @ ${{ github.sha }}"
49+ git push
You can’t perform that action at this time.
0 commit comments