[core] Add auto dispatch + Extend the mgit example (#49)
#35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync User Manual to Wiki | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'docs/user_manual.md' | |
| workflow_dispatch: | |
| jobs: | |
| sync-wiki: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Push user_manual.md to Wiki | |
| run: | | |
| git clone https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git wiki | |
| cp docs/user_manual.md wiki/Home.md | |
| cd wiki | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Home.md | |
| git diff --staged --quiet || git commit -m "docs: sync user manual from docs/user_manual.md" | |
| git push |