-
Notifications
You must be signed in to change notification settings - Fork 3
34 lines (28 loc) · 954 Bytes
/
update_readme.yml
File metadata and controls
34 lines (28 loc) · 954 Bytes
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
name: Update README on Push
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for all tags and branches
token: ${{ secrets.ACCESS_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
- name: Run the script to update README.md
run: python3 generate_readme.py
- name: Commit and push if changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git diff --quiet && git diff --staged --quiet || (git add README.md && git commit -m "Automatically update README.md" && git push)