diff --git a/.github/workflows/wiki-sync.yml b/.github/workflows/wiki-sync.yml new file mode 100644 index 0000000..23d379c --- /dev/null +++ b/.github/workflows/wiki-sync.yml @@ -0,0 +1,30 @@ +name: Wiki Sync + +on: + push: + branches: [main] + paths: ['wiki/**'] + +jobs: + sync-wiki: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - name: Sync wiki pages + run: | + git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki-repo + rm -rf wiki-repo/*.md + cp wiki/*.md wiki-repo/ + cd wiki-repo + 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 wiki from main" + git push + fi