-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (42 loc) · 1.16 KB
/
Copy pathsync-github-wiki.yml
File metadata and controls
48 lines (42 loc) · 1.16 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
42
43
44
45
46
47
48
name: Sync docs to GitHub Wiki
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: read
jobs:
sync:
name: Sync
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Clone GitHub Wiki
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
run: |
git clone "https://x-access-token:${GH_TOKEN}@github.com/${REPO}.wiki.git" wiki-repo
- name: Copy markdown files
run: |
for f in wiki/*.md; do
dest="wiki-repo/$(basename "$f" | tr ' ' '-')"
cp "$f" "$dest"
done
- name: Commit and push
working-directory: wiki-repo
run: |
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 "Sync docs from main"
git push
fi