-
Notifications
You must be signed in to change notification settings - Fork 26
76 lines (63 loc) · 2.28 KB
/
Copy pathupdate_hackmd_notes.yml
File metadata and controls
76 lines (63 loc) · 2.28 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
name: Update HackMD Notes
on:
schedule:
# Runs daily at 9:30 UTC (after council briefing at 9:00)
- cron: '30 9 * * *'
workflow_dispatch:
concurrency:
group: knowledge-repo-writes
cancel-in-progress: false
jobs:
update-notes:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python environment
uses: ./.github/actions/setup-python-env
with:
python-version: '3.12'
packages: 'requests'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install HackMD CLI
run: npm install -g @hackmd/hackmd-cli
- name: Create new notes if needed
id: create_notes
env:
HMD_API_ACCESS_TOKEN: ${{ secrets.HMD_API_ACCESS_TOKEN }}
run: |
python scripts/integrations/hackmd/create.py
- name: Update notes content and book index
id: update_notes
env:
HMD_API_ACCESS_TOKEN: ${{ secrets.HMD_API_ACCESS_TOKEN }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
run: |
python scripts/integrations/hackmd/update.py --json
- name: Generate council episodes summary for Discord
id: episodes_summary
env:
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
continue-on-error: true
run: |
# Generate discord-optimized episode summary (optional step)
python scripts/integrations/discord/summarize-episodes.py -o hackmd/council-episodes/discord-summary.md
- name: Pull latest changes before commit
run: |
git fetch origin main
git rebase origin/main || { git rebase --abort; exit 1; }
- name: Commit updated files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Update HackMD notes and backups"
file_pattern: "book.json hackmd/**/**/*.md hackmd/**/**/*.json"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"