luxon-hijri/.github/workflows/wiki-sync.yml

44 lines
1.2 KiB
YAML

name: Wiki Sync
on:
push:
branches: [main]
paths:
- '.github/wiki/**'
permissions:
contents: write
jobs:
sync:
name: Sync .github/wiki/ to GitHub Wiki
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout wiki repo
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
path: wiki-repo
token: ${{ secrets.GITHUB_TOKEN }}
- name: Copy wiki files
run: |
# Copy root wiki pages
cp .github/wiki/*.md wiki-repo/
# Copy subdirectories (api/, guides/, examples/, benchmarks/)
for dir in .github/wiki/*/; do
subdir=$(basename "$dir")
mkdir -p "wiki-repo/$subdir"
cp "$dir"*.md "wiki-repo/$subdir/" 2>/dev/null || true
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
git diff --cached --quiet || git commit -m "Sync wiki from .github/wiki/ [skip ci]"
git push