-
-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (35 loc) · 1.12 KB
/
create-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
39
40
name: Readme update
on:
workflow_run:
workflows: ["Badges"]
types:
- completed
workflow_dispatch:
jobs:
readme-update:
runs-on: ubuntu-latest
steps:
- name: Setup Git Configurations
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions[bot]"
- name: Check out repository code
uses: actions/checkout@v2
with:
fetch-depth: 1
ref: main
token: ${{ secrets.PAT }}
- name: Build README.md from external markdown files
run: |
cat conf/github/header.md conf/github/badges.md conf/github/access.md conf/github/contribute.md conf/github/credits.md conf/github/testing.md conf/github/roadmap.md conf/github/footer.md > README.md
- name: Commit updated README.md if there are changes
run: |
git add README.md
# Check if there are changes to commit
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "README.md updated."
git pull --rebase origin main
git push origin main
fi