-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.5 KB
/
Copy pathwiki-sync.yml
File metadata and controls
55 lines (46 loc) · 1.5 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
49
50
51
52
53
54
55
# Wiki Sync — Automatically publish docs/wiki/ to GitHub Wiki tab
# Triggers on push to main when wiki source files change
name: Wiki Sync
on:
push:
branches: [main]
paths:
- 'docs/wiki/**'
permissions:
contents: read
jobs:
sync-wiki:
name: Sync Wiki Pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Checkout wiki repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: RUN-APPAREL/RUN.wiki
path: wiki
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- name: Sync wiki source files
run: |
# Copy all wiki markdown files
cp docs/wiki/*.md wiki/
# Remove the wiki README (it stays in the main repo only)
rm -f wiki/README.md
# Check if there are changes to commit
cd wiki
if git diff --quiet && git diff --cached --quiet; then
echo "No wiki changes to sync."
exit 0
fi
# Configure git and push
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "docs(wiki): sync from docs/wiki/ [automated]"
git push