Repository navigation
49 lines (41 loc) · 1.51 KB
/
Copy pathsync-topic.yml
File metadata and controls
49 lines (41 loc) · 1.51 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
name: Daily sync from GitHub dsh-plugin topic
on:
schedule:
- cron: '17 4 * * *' # 每天 04:17 UTC(错峰)
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install marked (README renderer)
run: npm install marked
- name: Run topic sync
run: |
python scripts/sync-topic.py
python scripts/gen-repos.py
python scripts/gen-sitemap.py
python scripts/gen-badges.py
python scripts/fetch-contributors.py > /tmp/contributors.log 2>&1
python scripts/fetch-repo-enrich.py --limit 500 >> /tmp/contributors.log 2>&1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add src/data/plugins.json src/data/sync-date.json functions/api/repos.js functions/badges/data.js public/sitemap.xml src/data/contributors.json src/data/readmes.json
if git diff --cached --quiet; then
echo "no change"
else
git commit -m "chore: daily sync ($(date -u +%Y-%m-%d))"
git push
fi