-
Notifications
You must be signed in to change notification settings - Fork 570
41 lines (33 loc) · 1.02 KB
/
update-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
41
name: Update README
on:
push:
branches:
- master # This repo is using 'master' as the main branch name
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.12
- name: Install dependencies
run: pip install pyyaml
- name: Update README.md
run: python scripts/update_readme.py
- name: Check if README.md has changed
id: readme_diff
run: |
git diff README.md || echo "README_CHANGED=true" >> $GITHUB_ENV
- name: Commit and push changes
if: env.README_CHANGED == 'true'
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add README.md
git commit -m "Update README date and links"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}