-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (78 loc) · 2.5 KB
/
weekly-summaries.yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Weekly Contributor Update
on:
schedule:
- cron: '0 19 * * 5' # Run at 2:00 PM EST (19:00 UTC) every Friday
workflow_dispatch:
permissions:
contents: write
jobs:
update-contributors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python & Node.js
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip' # Enable pip caching
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm' # Enable npm caching
- name: Cache API responses
uses: actions/cache@v3
with:
path: |
.cache/github_api
.cache/openai_api
key: ${{ runner.os }}-api-cache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-api-cache-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
npm ci
# Combined PR and contributor data fetch
- name: Fetch GitHub data
env:
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
run: |
# Create directories
mkdir -p data/reports issues_prs
# Get date range
WEEK_END=$(date +%Y-%m-%d)
WEEK_START=$(date -d "7 days ago" +%Y-%m-%d)
# Single API call to fetch both PRs and contributor data
python scripts/fetch_combined_data.py \
--repo ai16z/eliza \
--start-date "$WEEK_START" \
--end-date "$WEEK_END" \
--output-dir ./data
- name: Generate analysis
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
WEEK_END=$(date +%Y-%m-%d)
# Generate summaries and analysis in parallel
python scripts/parallel_analysis.py \
--input-dir ./data \
--output-dir ./data/reports \
--date "$WEEK_END"
- name: Build and deploy
run: |
npm run build
npm run generate
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# Stage all changes at once
git add data/ profiles/ data/reports/ issues_prs/
# Single commit
git diff --staged --quiet || git commit -m "Update contributor data and reports [skip ci]"
git push
env:
GITHUB_TOKEN: ${{ github.token }}