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+ workflow_dispatch :
5+ push :
6+ branches : [main]
7+ paths :
8+ - ' wiki/**'
9+ - ' docs/wiki/**'
10+
11+ permissions :
12+ contents : write
13+
14+ jobs :
15+ sync :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - name : Prepare wiki content
21+ run : |
22+ mkdir -p /tmp/ai-os-wiki
23+ cp -R wiki/. /tmp/ai-os-wiki/
24+ find /tmp/ai-os-wiki -type f -name '*.md' -print
25+
26+ - name : Push wiki pages
27+ env :
28+ TOKEN : ${{ secrets.WIKI_TOKEN || secrets.GITHUB_TOKEN }}
29+ run : |
30+ set -euo pipefail
31+ git config --global user.name "github-actions[bot]"
32+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
33+ git clone "https://x-access-token:${TOKEN}@github.com/${{ github.repository }}.wiki.git" /tmp/wiki-repo
34+ rsync -av --delete /tmp/ai-os-wiki/ /tmp/wiki-repo/
35+ cd /tmp/wiki-repo
36+ git add .
37+ if git diff --cached --quiet; then
38+ echo "Wiki already up to date"
39+ else
40+ git commit -m "docs: sync wiki pages"
41+ git push
42+ fi
You can’t perform that action at this time.
0 commit comments