Update docs #121
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: Modular README.md | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [open, synchronize] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- run: sed -i '/<!-- _README:START -->/,/<!-- _README:END -->/d' README.md | |
- run: echo '<!-- _README:START -->' >> README.md | |
- run: cat _README.md >> README.md | |
- run: echo '<!-- _README:END -->' >> README.md | |
- run: git config --global --add safe.directory /github/workspace | |
- name: pull-request | |
uses: repo-sync/pull-request@v2 | |
with: | |
destination_branch: "main" | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: commit | |
run: | | |
git config --global user.email youremail | |
git config --global user.name yourusername | |
git diff --quiet || (git add . git commit -m "README update Automation" -a) | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |