Update workflow to copy README to Wiki #7
This file contains 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 README to Wiki | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
sync-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout base code | |
uses: actions/checkout@v2 | |
with: | |
path: base-code | |
- name: Checkout wiki code | |
uses: actions/checkout@v2 | |
with: | |
repository: ${{ github.repository }}.wiki | |
path: wiki | |
- name: Copy README.md to wiki | |
run: | | |
cp base-code/README.md wiki/README.md | |
- name: Push to wiki | |
run: | | |
cd wiki | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add README.md | |
git diff-index --quiet HEAD || git commit -m "Sync README.md to wiki" && git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |