-
Notifications
You must be signed in to change notification settings - Fork 62
39 lines (32 loc) · 1003 Bytes
/
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
name: Update README
on:
push:
branches:
- main
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: pip install requests
- name: Check commit count
id: commit-count
run: echo ::set-output name=commit_count::$(git rev-list --count HEAD)
- name: Update README
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
commitCount=$(echo "${{ steps.commit-count.outputs.commit_count }}")
if [[ $((commitCount % 10)) -eq 0 ]]; then
python update_readme.py
git commit -am "Update contributors in README [skip ci]" --quiet --allow-empty
git push --quiet
else
echo "Skipping update"
fi