Skip to content

Commit 5ec8f3f

Browse files
committed
feat: 添加缓存用的fetchdata
1 parent 62c5517 commit 5ec8f3f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/fetch-data.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Fetch and Cache Repo Data
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 2 * * *' # 每天凌晨2点自动运行
7+
8+
jobs:
9+
fetch-data:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
20+
- name: Install dependencies
21+
run: |
22+
pnpm install || npm install
23+
24+
- name: Run fetch.js to generate data
25+
run: node cache/fetch.js
26+
27+
- name: Create or update release with data file
28+
uses: softprops/action-gh-release@v1
29+
with:
30+
tag_name: data-cache
31+
name: Cached Repo Data
32+
body: 'Auto-generated repo and NPM data file.'
33+
files: fetched-data.json
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)