-
Notifications
You must be signed in to change notification settings - Fork 19
46 lines (39 loc) · 1.1 KB
/
sync-wiki.yml
File metadata and controls
46 lines (39 loc) · 1.1 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
name: Sync Docs to Wiki
on:
push:
branches:
- main
paths:
- 'current/docs/**'
workflow_dispatch:
permissions:
contents: write
jobs:
sync-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Clone wiki repository
run: |
git clone "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git" wiki-repo
- name: Copy docs to wiki
run: |
cp current/docs/*.md wiki-repo/
- name: Configure git identity
working-directory: wiki-repo
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and push changes
working-directory: wiki-repo
run: |
git add .
if git diff --cached --quiet; then
echo "No changes to sync."
else
git commit -m "docs: sync from main (${{ github.sha }})"
git push
fi