-
-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (35 loc) · 1.17 KB
/
update-progress.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
42
43
44
name: Update Progress Badge
on:
push:
branches:
- main
schedule:
- cron: '0 22 * * *' # Optional: Set a daily schedule for updates
workflow_dispatch: # Manual trigger option
jobs:
update-progress-badge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install requests # You can add any other dependencies you need
- name: Calculate Progress and Update README
run: |
python src/calculate_progress.py ${{ github.repository_owner }} ${{ secrets.GITHUB_TOKEN }} README.md
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "GitHub Actions"
git add README.md
git diff-index --quiet HEAD || git commit -m "Update progress badge"
- name: Pull changes
run: git pull -r
- name: Push changes
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df
with:
github_token: ${{ secrets.GITHUB_TOKEN }}