-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add comment summary template for activity report highlights #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b7c766d
feat: add comment summary template for activity report highlights
mmcky bfcaef1
docs: add auto-post workflow for comment summary template
mmcky e6d4307
feat: auto-detect contributors from PRs and use markdown links
mmcky e94b6e9
feat: add release tracking to comment summary template (#3)
mmcky ba99e2a
fix: resolve merge conflicts with main
mmcky 326be54
fix: replace unsafe shell interpolation example with safe patterns
mmcky a9a8c09
fix: remove no-op shift statements and add trailing newline to action…
mmcky a15bffd
feat: gate debug output behind --debug flag
mmcky f25d5eb
fix: address set -e API call safety, date formatting, and docs accuracy
mmcky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # Generated reports from local testing | ||
| report.md | ||
| weekly-report.md | ||
| comment-template.md | ||
| *.md.bak | ||
|
|
||
| # macOS | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| # Comment Summary Template | ||
|
|
||
| The comment summary template feature auto-generates an editable markdown template containing merged PR details from the report period. This helps write the "highlights" comment that accompanies each activity report. | ||
|
|
||
| > **Note:** The template includes up to 100 merged PRs and 100 releases per repository (the GitHub API default page size). For most repositories and weekly report windows, this covers all activity. | ||
|
|
||
| ## Background | ||
|
|
||
| Activity reports generated by this action contain a metrics table (issues, PRs, commits). The accompanying comment — written by a maintainer — provides high-level context about what was accomplished. This feature bridges the gap by collecting the raw PR data needed to write that comment. | ||
|
|
||
| See [QuantEcon/meta#280](https://github.com/QuantEcon/meta/issues/280) for an example of a report with a hand-written highlights comment. | ||
|
|
||
| ## Usage | ||
|
|
||
| ### CLI | ||
|
|
||
| ```bash | ||
| # Generate report with comment summary template | ||
| ./generate-report.sh --token=ghp_xxxxx --summary-template | ||
|
|
||
| # Custom output filename | ||
| ./generate-report.sh --token=ghp_xxxxx --summary-template --summary-template-file=highlights.md | ||
| ``` | ||
|
|
||
| ### GitHub Action | ||
|
|
||
| ```yaml | ||
| - name: Generate activity report | ||
| uses: QuantEcon/action-weekly-report@v2 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| summary-template: 'true' | ||
| summary-template-file: 'comment-template.md' | ||
| ``` | ||
|
|
||
| ## Output Format | ||
|
|
||
| The template is written to `comment-template.md` (default) and contains: | ||
|
|
||
| 1. **Placeholder summary** — Editable topic bullets for high-level themes | ||
| 2. **Releases table** — All releases published in the period in a single table (omitted if none) | ||
| 3. **Merged PRs by repository** — Merged PRs with title, URL, labels, and author | ||
| 4. **Contributor acknowledgement** — Auto-generated from PR authors (bots and Copilot excluded) | ||
|
|
||
| ### Example Output | ||
|
|
||
| ```markdown | ||
| **High Level Summary:** | ||
|
|
||
| 1. **[Topic 1]** _Add a high-level summary of work in this area._ | ||
| 2. **[Topic 2]** _Add another thematic summary._ | ||
|
|
||
| --- | ||
|
|
||
| ## 📦 Releases | ||
|
|
||
| | Repository | Release | Date | | ||
| |------------|---------|------| | ||
| | lecture-python.myst | [publish-2026feb19b](https://github.com/.../publish-2026feb19b) | Feb 19 | | ||
| | quantecon-book-theme | [v0.17.0](https://github.com/.../v0.17.0) | Feb 19 | | ||
| | QuantEcon.py | [v0.11.0](https://github.com/.../v0.11.0) | Feb 15 | | ||
|
|
||
| **lecture-python.myst:** | ||
| - [Update consumer problem lecture](https://github.com/QuantEcon/lecture-python.myst/pull/757) [maintenance] (@HumphreyYang) | ||
| - [Fix typo in GDP lecture](https://github.com/QuantEcon/lecture-python.myst/pull/756) (@contributor) | ||
|
|
||
| **quantecon-book-theme:** | ||
| - [Major refactor for responsiveness](https://github.com/QuantEcon/quantecon-book-theme/pull/335) [infrastructure, priority: high] (@mmcky) | ||
|
|
||
| --- | ||
|
|
||
| thanks @HumphreyYang, @mmcky, and @contributor for all your contributions. | ||
| ``` | ||
|
|
||
| ## How Labels Help | ||
|
|
||
| When PRs have labels (e.g., `maintenance`, `infrastructure`, `bug`, `priority: high`), they appear in brackets next to each PR. This makes it easier to: | ||
|
|
||
| - **Group by theme** — Quickly identify which PRs relate to maintenance vs. new features | ||
| - **Prioritize highlights** — Spot high-priority work at a glance | ||
| - **Categorize** — Reorganize the flat per-repo list into thematic sections | ||
|
|
||
| For maximum benefit, use standardized labels across repositories. See [QuantEcon/meta#178](https://github.com/QuantEcon/meta/issues/178) for the labels standardization initiative. | ||
|
|
||
| ## Workflow | ||
|
|
||
| ### Automated (GitHub Actions) | ||
|
|
||
| The template can be auto-posted as a comment on the activity report issue: | ||
|
|
||
| ```yaml | ||
| # Step 1: Generate report + template | ||
| - name: Generate weekly report | ||
| uses: QuantEcon/action-weekly-report@v2 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| summary-template: 'true' | ||
|
|
||
| # Step 2: Create issue from report | ||
| - name: Create issue from report | ||
| id: create-issue | ||
| uses: peter-evans/create-issue-from-file@v4 | ||
| with: | ||
| title: Weekly Activity Report | ||
| content-filepath: weekly-report.md | ||
| labels: report, automated | ||
|
|
||
| # Step 3: Post template as first comment | ||
| - name: Post comment summary template | ||
| if: hashFiles('comment-template.md') != '' | ||
| uses: peter-evans/create-or-update-comment@v4 | ||
mmcky marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| issue-number: ${{ steps.create-issue.outputs.issue-number }} | ||
| body-path: comment-template.md | ||
| ``` | ||
|
|
||
| The template lands as the first comment on the new issue. A maintainer then edits that comment to curate the highlights. | ||
|
|
||
| ### Manual | ||
|
|
||
| 1. Run the action or CLI with `summary-template` enabled | ||
| 2. Open `comment-template.md` — merged PRs are listed by repo | ||
| 3. Reorganize into thematic sections (Lectures, Infrastructure, Libraries, etc.) | ||
| 4. Add high-level context for each section | ||
| 5. Remove PRs that don't need highlighting (e.g., automated dependency bumps) | ||
| 6. Post as a comment on the activity report issue | ||
|
|
||
| ## Action Outputs | ||
|
|
||
| The template content is also available as the `comment-template` output for use in downstream workflow steps: | ||
|
|
||
| ```yaml | ||
| - name: Generate report | ||
| id: report | ||
| uses: QuantEcon/action-weekly-report@v2 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| summary-template: 'true' | ||
|
|
||
| # Option 1: Pass to an action input (recommended — inherently safe) | ||
| - name: Post comment | ||
| uses: peter-evans/create-or-update-comment@v4 | ||
| with: | ||
| issue-number: 1 | ||
| body: ${{ steps.report.outputs.comment-template }} | ||
mmcky marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Option 2: Use via environment variable (safe for run steps) | ||
| - name: Use template content | ||
| env: | ||
| TEMPLATE: ${{ steps.report.outputs.comment-template }} | ||
| run: echo "$TEMPLATE" | ||
| ``` | ||
|
|
||
| > **Security note:** Never interpolate `${{ steps.report.outputs.comment-template }}` | ||
| > directly in a `run:` block. The output contains PR titles, labels, and author names | ||
| > which could include shell metacharacters. Always pass it through an `env:` variable | ||
| > or an action `with:` input to avoid shell injection. | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Input | Description | Default | | ||
| |-------|-------------|---------| | ||
| | `summary-template` | Enable template generation (`true`/`false`) | `false` | | ||
| | `summary-template-file` | Output filename | `comment-template.md` | | ||
|
|
||
| | CLI Flag | Description | | ||
| |----------|-------------| | ||
| | `--summary-template` | Enable template generation | | ||
| | `--summary-template-file=FILE` | Output filename (default: `comment-template.md`) | | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.