Skip to content

Commit 49a1ba1

Browse files
committed
ci: auto-refresh website GitHub activity 3x daily
Adds a GitHub Actions cron workflow that fetches the latest releases and commits from the GitHub API and commits the updated github-activity.json to the repo. Schedule: 3x daily (00:00, 08:00, 16:00 UTC). Also runnable manually via workflow_dispatch. Only commits when the data actually changed (git diff check), so empty runs produce no noise. Uses [skip ci] to avoid triggering the full test suite on data-only commits.
1 parent 6a1f030 commit 49a1ba1

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Website Data Refresh
2+
3+
# Refreshes the build-time data (GitHub releases, commits, provenance,
4+
# pipeline fragments) that the website sidebar and sections display.
5+
# Runs 3x daily so the sidebar always shows recent activity without
6+
# anyone manually running the scripts.
7+
8+
on:
9+
schedule:
10+
# 3x daily: 00:00, 08:00, 16:00 UTC
11+
- cron: "0 0,8,16 * * *"
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: write
16+
17+
concurrency:
18+
group: website-data-refresh
19+
cancel-in-progress: true
20+
21+
jobs:
22+
refresh:
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 10
25+
steps:
26+
- name: Check out repository
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.12"
33+
34+
- name: Fetch GitHub activity data
35+
run: python3 website/scripts/fetch-github-data.py
36+
37+
- name: Check for changes
38+
id: changes
39+
run: |
40+
if git diff --quiet website/src/data/github-activity.json; then
41+
echo "changed=false" >> "$GITHUB_OUTPUT"
42+
else
43+
echo "changed=true" >> "$GITHUB_OUTPUT"
44+
fi
45+
46+
- name: Commit refreshed data
47+
if: steps.changes.outputs.changed == 'true'
48+
run: |
49+
git config user.name "github-actions[bot]"
50+
git config user.email "github-actions[bot]@users.noreply.github.com"
51+
git add website/src/data/github-activity.json
52+
git commit -m "chore(website): refresh GitHub activity data [skip ci]
53+
54+
Auto-generated by website-data-refresh workflow.
55+
Fetched: $(date -u '+%Y-%m-%d %H:%M UTC')"
56+
git push

0 commit comments

Comments
 (0)