features update #22
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 Wiki | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**/*.md' | |
- '.github/workflows/sync-wiki.yml' | |
- '.github/workflows/markdownList.yml' | |
- '.github/scripts/sync-wiki.py' | |
workflow_dispatch: | |
jobs: | |
sync-wiki: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
path: repo | |
- name: Checkout Wiki | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.repository }}.wiki | |
path: wiki | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: pip install pyyaml | |
- name: Sync markdown files to Wiki | |
run: | | |
python $GITHUB_WORKSPACE/repo/.github/scripts/sync-wiki.py | |
env: | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
- name: Push changes to wiki | |
run: | | |
cd wiki | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
git add . | |
git diff --quiet && git diff --staged --quiet || (git commit -m "Auto sync wiki from main repository" && git push) |