-
Notifications
You must be signed in to change notification settings - Fork 6
41 lines (35 loc) · 1.01 KB
/
sync-docs-to-wiki.yml
File metadata and controls
41 lines (35 loc) · 1.01 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
40
41
name: Sync docs to Wiki
on:
push:
branches: [ main ]
paths:
- 'docs/**'
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Clone GitHub Wiki
run: |
git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki
- name: Sync docs to wiki
run: |
rsync -av --delete --exclude='.git' docs/ wiki/
cd wiki
git add -A
if [ -n "$(git status --porcelain)" ]; then
git commit -m "Sync docs from repository [skip ci]"
git push origin HEAD
else
echo "No changes to commit"
fi