-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.4 KB
/
Copy pathupdate-projects.yml
File metadata and controls
53 lines (45 loc) · 1.4 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
52
53
name: Update Projects Metadata
on:
schedule:
# 毎日 0:00 UTC (日本時間 9:00) に実行
- cron: '0 0 * * *'
workflow_dispatch: # 手動実行を許可
push:
branches:
- main
paths:
- 'projects-list.txt'
- 'scripts/fetch-metadata.py'
jobs:
update-metadata:
runs-on: ubuntu-latest
permissions:
contents: write # リポジトリへの書き込み権限(コミット・プッシュ用)
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install requests pyyaml
- name: Fetch project metadata
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/fetch-metadata.py
- name: Commit and push if changed
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [[ -n $(git status -s) ]]; then
git add projects.json
git commit -m "🔄 Update projects metadata [automated]"
git push
else
echo "No changes to commit"
fi