-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (32 loc) · 1.06 KB
/
readme.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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 }}