-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (38 loc) · 1.11 KB
/
update-github-activity.yaml
File metadata and controls
44 lines (38 loc) · 1.11 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
name: Update GitHub Activity
on:
schedule:
# 30分ごとに実行
- cron: '*/30 * * * *'
workflow_dispatch: # 手動実行も可能
jobs:
update-activity:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.18.1'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Fetch GitHub activity
run: npm run fetch-github-activity
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit and push activity data
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add data/github_activity.json
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update GitHub activity data (scheduled)"
git push
fi