-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 906 Bytes
/
Copy pathwiki-sync.yml
File metadata and controls
38 lines (33 loc) · 906 Bytes
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
name: Sync Wiki
on:
push:
branches: [main]
paths:
- 'docs/wiki/**'
permissions:
contents: write
jobs:
sync-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout wiki
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
path: wiki
token: ${{ secrets.GITHUB_TOKEN }}
- name: Sync wiki files
run: |
cp docs/wiki/*.md wiki/
cd wiki
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "No changes to sync"
else
git commit -m "docs: sync wiki from docs/wiki ($(date -u +%Y-%m-%dT%H:%M:%SZ))"
git push
fi