-
Notifications
You must be signed in to change notification settings - Fork 40
51 lines (44 loc) · 1.39 KB
/
Copy pathupdate-star-history.yml
File metadata and controls
51 lines (44 loc) · 1.39 KB
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
45
46
47
48
49
50
51
name: Update star history
on:
workflow_dispatch:
schedule:
- cron: "17 3 * * *"
push:
branches:
- master
paths:
- ".github/scripts/generate_star_history.py"
- ".github/workflows/update-star-history.yml"
permissions:
contents: write
concurrency:
group: update-star-history
cancel-in-progress: true
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out the default branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Generate star history charts
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python .github/scripts/generate_star_history.py
- name: Commit updated charts
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add assets/star-history.svg assets/star-history-dark.svg
if git diff --cached --quiet; then
echo "Star history is already up to date."
exit 0
fi
git commit -m "docs: update star history [skip ci]"
git push origin "HEAD:${{ github.event.repository.default_branch }}"