-
Notifications
You must be signed in to change notification settings - Fork 24
39 lines (32 loc) · 940 Bytes
/
UpdateReadmeOnPush.yml
File metadata and controls
39 lines (32 loc) · 940 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
35
36
37
38
39
name: Update README on Push
on:
push:
branches:
- master
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.12'
- name: Run Python script to update README
run: |
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
echo "$CHANGED_FILES"
python update_readme.py $CHANGED_FILES
- name: Commit changes
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add README.md
git commit -m "Update README"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.CODEFORCES_GITHUB_TOKEN }}