-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (69 loc) · 2.59 KB
/
github-activity-digest.yml
File metadata and controls
82 lines (69 loc) · 2.59 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
73
74
75
76
77
78
79
80
81
82
name: Publish GitHub Activity Digest
on:
workflow_dispatch:
schedule:
- cron: '13 7 * * *'
permissions:
contents: write
concurrency:
group: github-activity-digest-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout activity-recognition
uses: actions/checkout@v4
- name: Checkout github-activity-digest source
uses: actions/checkout@v4
with:
repository: syslabcom/github-activity-digest
path: tools/github-activity-digest
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Restore digest cache
uses: actions/cache@v4
with:
path: tools/github-activity-digest/.cache
key: github-activity-digest-${{ runner.os }}-${{ github.run_id }}
restore-keys: |
github-activity-digest-${{ runner.os }}-
- name: Install digest dependencies
working-directory: tools/github-activity-digest
run: bun install --frozen-lockfile
- name: Apply local digest config and custom prompt
run: |
cp digest/config.json tools/github-activity-digest/config.json
cp digest/prompt-template-activity-recognition.txt tools/github-activity-digest/prompt-template-activity-recognition.txt
- name: Run github-activity-digest
shell: bash
working-directory: tools/github-activity-digest
env:
GITHUB_TOKEN: ${{ github.token }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
set -o pipefail
bun run index.ts 2>&1 | tee "$RUNNER_TEMP/github-activity-digest.log"
- name: Publish digest data
run: |
python3 scripts/publish_github_activity_digest.py \
--config-file "digest/config.json" \
--summary-file "tools/github-activity-digest/archive/weekly-report-$(date -u +%F).md" \
--log-file "$RUNNER_TEMP/github-activity-digest.log" \
--output-dir "docs/data" \
--source-repository "syslabcom/github-activity-digest" \
--source-config-path "digest/config.json"
- name: Commit published data
shell: bash
run: |
git add docs/data
git diff --staged --quiet && {
echo "No data changes to commit."
exit 0
}
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Update GitHub activity digest data"
git push