Skip to content

Update workflow to copy README to Wiki #6

Update workflow to copy README to Wiki

Update workflow to copy README to Wiki #6

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
ref: main
- 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 "action@github.com"
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 }}