-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.25 KB
/
update_wiki.yaml
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: Update Wiki
on:
push:
branches:
- main
workflow_dispatch:
jobs:
update-wiki:
name: Update Wiki with gomarkdocs output
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23.0'
- name: Install gomarkdoc
run: go install github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest
- name: Clone Wiki repository
run: |
git clone https://github.com/${{ github.repository }}.wiki.git wiki
- name: Generate documentation
run: gomarkdoc --output wiki/Home.md
- name: Commit and push changes if needed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd wiki
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
if [[ -n "$(git status --porcelain)" ]]; then
git add Home.md
git commit -m "Update Wiki documentation [ci skip]"
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.wiki.git
else
echo "No changes to commit"
fi