-
-
Notifications
You must be signed in to change notification settings - Fork 5
72 lines (61 loc) Β· 2.25 KB
/
Copy pathweekly.yml
File metadata and controls
72 lines (61 loc) Β· 2.25 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Weekly Digest
on:
schedule:
- cron: '0 0 * * 1' # Monday UTC midnight
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
concurrency:
group: digest-push-${{ github.ref }}
cancel-in-progress: false
jobs:
weekly:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Sync latest branch
run: git pull --rebase origin ${{ github.ref_name }}
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run weekly rollup
run: python main.py --mode weekly
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
API_NINJAS_KEY: ${{ secrets.API_NINJAS_KEY }}
# ββ Optional delivery sinks ββββββββββββββββββββββββββββββββββ
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SERVERCHAN_SENDKEY: ${{ secrets.SERVERCHAN_SENDKEY }}
- name: Commit and push weekly report
run: |
# Generated JSON stays ignored locally, so CI force-adds it when publishing.
git add docs/
git add -f docs/data/
git diff --staged --quiet || git commit -m "weekly: $(date -u +%Y-W%V)"
git pull --rebase -X ours origin ${{ github.ref_name }}
git push
- name: Trigger Pages publish
env:
GH_TOKEN: ${{ github.token }}
GH_API_URL: ${{ github.api_url }}
GH_REPOSITORY: ${{ github.repository }}
GH_REF_NAME: ${{ github.ref_name }}
run: |
curl --fail-with-body -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GH_TOKEN}" \
"${GH_API_URL}/repos/${GH_REPOSITORY}/actions/workflows/pages.yml/dispatches" \
-d "{\"ref\":\"${GH_REF_NAME}\"}"