name: Sync Wiki on: push: branches: - main paths: - 'benchmarks/*/readme.md' - '.github/workflows/sync-wiki.yml' 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.x' - name: Install dependencies run: pip install beautifulsoup4 - name: Sync specific README 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)