Repository navigation
ENH: enable curated highlights in weekly report workflow - #305
Conversation
action-weekly-report v2.4.0 ships a new curated highlights view — PRs grouped by theme (Lectures / Libraries / Tooling / Courses / Other), bot/dependency noise rolled up, translation-sync PRs in a collapsed section, optional one-sentence per-theme narratives via Claude. See QuantEcon/reports-activity#6 for context and docs/highlights.md in the action repo for the feature reference. This commit: - Adds `highlights: 'true'` and `llm-summary: 'true'` action inputs. The action picks them up via the floating @v2 tag — no version pin change needed. - Wires ANTHROPIC_API_KEY through as an env var (required for the LLM narrative pass; missing key degrades to heuristic-only with a warning, never blocks the build). - Extends the existing github-script step to capture the issue number returned by issues.create and post highlights.md as the first comment on that issue. Falls back gracefully if highlights.md isn't produced. - Drops the now-removed `output-format: 'markdown'` input (the selector was vaporware in v2.3.0 and removed in v2.4.0; existing workflows passing it get an unrecognised-input warning). - Adds report-data.json and highlights.md to the uploaded artifact bundle so we can re-run tools/highlights.py offline (e.g. to retune themes or compare LLM models) without re-fetching from GitHub. Prerequisite: ANTHROPIC_API_KEY must be added to this repo's secrets before the first run. Settings → Secrets and variables → Actions → New repository secret. Until then llm-summary still works but the narratives are skipped with a warning. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Enables the new “curated highlights” output from QuantEcon/action-weekly-report@v2 in the weekly report workflow, including optional LLM-generated theme narratives, and posts the highlights to the created report issue.
Changes:
- Enables
highlightsandllm-summaryaction inputs and wires throughANTHROPIC_API_KEY. - Extends the
github-scriptstep to posthighlights.mdas the first issue comment after creating the report issue. - Uploads additional generated files (
weekly-report-data.json,highlights.md) in the workflow artifact bundle.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: issue.data.number, | ||
| body: highlights, | ||
| }); | ||
| console.log(`Posted highlights.md (${highlights.length} chars) as first comment`); |
There was a problem hiding this comment.
Good catch — addressed in follow-up #306. Two changes: (1) truncate the body to fit GitHub's 65,536-char limit with a pointer to the artifact, (2) wrap createComment in try/catch so transient API failures log + continue rather than failing the run. The issue itself is created in the line above, so the report is preserved regardless of what happens to the comment step.
) * chore: harden highlights comment posting against API/size failures Addresses Copilot's feedback on #305: the createComment call could fail (oversize body, transient API error, rate limit) and crash the whole workflow even though the report issue has already been created. Two hardening changes: 1. Body-size truncation. GitHub caps issue comments at 65,536 chars. Today's highlights run at ~10K chars, well below the limit, but a busy month with --llm-summary across many translation-sync PRs could grow. If highlights.md exceeds the limit, truncate to fit and append a footer linking to the workflow run's artifact so the full content is recoverable. 2. try/catch around createComment. Transient API failures now log to stderr and continue rather than failing the step. Rationale: the report issue was already created in the preceding lines, so the report is preserved regardless of what happens to the comment. highlights.md is also in the uploaded artifact bundle, so the highlights themselves are recoverable manually. Net effect: the workflow now degrades gracefully on any comment-posting failure mode rather than turning red. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * address Copilot review on PR #306 Two follow-up tweaks both flagged on the inline review: 1. Wrap fs.readFileSync('highlights.md') in its own try/catch. existsSync doesn't guarantee the read succeeds (permission/IO errors are theoretically possible even on a fresh CI runner), and the asymmetry with the weekly-report.md read above was a smell. On read failure: log + null out and skip the comment path — behaves identically to "file not produced". 2. Log richer fields when createComment fails. Octokit errors carry .status and .response.data with the actual diagnostic, while .message is often terse ("Validation Failed"). The catch block now logs the HTTP status when present, falls back to String(err) if .message is missing, and appends response.data when available. Future debugging won't be limited to the bare .message. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Picks up the new curated highlights feature shipped in action-weekly-report v2.4.0 (PR QuantEcon/action-weekly-report#6). The weekly report will now produce a themed, noise-suppressed highlights view in addition to the existing tabular report, posted as the first comment on the report issue — matching the style of meta#259 and meta#291 but automated.
Changes
highlights: 'true'andllm-summary: 'true'to the action inputs.ANTHROPIC_API_KEYthrough so the LLM narrative pass can run.github-scriptstep to capture the issue number and posthighlights.mdas the first comment.output-format: 'markdown'input (vaporware in v2.3.0, formally removed in v2.4.0).weekly-report-data.jsonandhighlights.mdto the uploaded artifact bundle.The action is pinned to the floating
@v2tag (unchanged), so v2.4.0 is picked up automatically.Prerequisite
ANTHROPIC_API_KEYmust be added to this repo's secrets before the first run:Settings → Secrets and variables → Actions → New repository secret
Until then
llm-summarystill works but the narratives are skipped with a warning — the heuristic-only highlights still post as the comment.What the highlights look like
Verified end-to-end on the
2026-04-21..05-20window using v2.4.0:Each themed section gets a one-sentence LLM-drafted narrative (Sonnet 4.6 default). Sample for Libraries: "Extended
NormalFormGameandPlayerto support tuple-based constructors and payoff display, fixed field docstring syntax, and added NumPy random Generator API guidance."Test plan
ANTHROPIC_API_KEYrepo secretworkflow_dispatchto verify the first run before the next Saturday cron🤖 Generated with Claude Code