-
-
Notifications
You must be signed in to change notification settings - Fork 34
36 lines (31 loc) · 1.04 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
name: Generate Readme
on:
pull_request:
branches:
- "**"
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set executable permission for script
run: chmod +x ./.github/readme-format.sh
- name: Run readme format script
run: ./.github/readme-format.sh
- name: Commit changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Format the readme file"
git push origin ${{ github.event.pull_request.head.ref }}
else
echo "no icon has been added, nothing to generate."
fi