feat: comment on linked issues when a release ships#92
Merged
Conversation
… release Adds opt-in `comment_on_linked_issues` input that, when enabled, parses issue references (#N, owner/repo#N, GitHub issue URLs) from the generated release notes, checks if they are closed issues (not PRs), and posts a release notification comment on each qualifying issue. Bumps version to 3.1.0. Agent-Logs-Url: https://github.com/joshjohanning/publish-github-action/sessions/25438a04-9dea-4bb7-9244-e1dab9ef7f5f Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
Agent-Logs-Url: https://github.com/joshjohanning/publish-github-action/sessions/25438a04-9dea-4bb7-9244-e1dab9ef7f5f Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
Agent-Logs-Url: https://github.com/joshjohanning/publish-github-action/sessions/25438a04-9dea-4bb7-9244-e1dab9ef7f5f Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
Agent-Logs-Url: https://github.com/joshjohanning/publish-github-action/sessions/25438a04-9dea-4bb7-9244-e1dab9ef7f5f Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
…lse negatives Agent-Logs-Url: https://github.com/joshjohanning/publish-github-action/sessions/25438a04-9dea-4bb7-9244-e1dab9ef7f5f Co-authored-by: joshjohanning <19912012+joshjohanning@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add comment on linked issues when a release ships
feat: comment on linked issues when a release ships
Apr 15, 2026
Replace regex-based issue parsing with GraphQL closingIssuesReferences query on PRs found in release notes. This: - Eliminates the CodeQL polynomial-redos finding (no complex regex) - Uses the Development sidebar linkage (Fixes/Closes keywords) as source of truth instead of fragile text parsing - Adds idempotent comment posting with HTML marker — creates new comment or updates existing one (handles reruns, draft→publish, version changes) - Adds retryWithBackoff on GraphQL, listComments, createComment, and updateComment calls - Uses case-insensitive owner/repo comparison - Works with GHES (no hardcoded github.com in URL parsing)
…ore.debug mock - Filter marker comments by authenticated user to avoid updating other users' comments - Paginate closingIssuesReferences GraphQL connection instead of truncating at 50 - Add core.debug to test mock (was missing, causing silent failures) - Add tests: foreign marker comment ignored, GraphQL pagination across pages
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in feature to comment on closed issues linked to PRs included in GitHub-generated release notes, using GraphQL closingIssuesReferences for robustness across GitHub.com/GHES.
Changes:
- Add
comment_on_linked_issuesinput and implement PR-number parsing + GraphQL lookup of linked closing issues, posting/updating an idempotent marker comment. - Add Jest coverage for PR parsing and end-to-end linked-issue commenting scenarios (create/update/skip/dedupe/failures).
- Update docs/metadata (action.yml, README permissions) and bump version to
3.1.0(plus lockfile + coverage badge update).
Show a summary per file
| File | Description |
|---|---|
src/index.js |
Implements PR extraction, GraphQL issue discovery, and idempotent issue commenting behind a new input flag. |
__tests__/index.test.js |
Adds unit + integration tests for PR parsing and linked-issue comment behavior. |
action.yml |
Adds/updates the comment_on_linked_issues input description. |
README.md |
Documents the new input and required issues: write permission. |
package.json |
Bumps action version to 3.1.0. |
package-lock.json |
Syncs lockfile version fields with package.json. |
badges/coverage.svg |
Updates coverage badge content. |
Copilot's findings
- Files reviewed: 5/7 changed files
- Comments generated: 3
- Fix JSDoc param type to string | null | undefined for parsePullRequestNumbers - Add description to all retryWithBackoff calls for better diagnostics - When getAuthenticated fails, create new comment instead of matching any marker
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in feature to this Node.js GitHub Action to comment on closed issues that are linked to pull requests included in the generated release notes, so issue followers get notified when a release ships.
Changes:
- Add
comment_on_linked_issuesinput and logic to parse PR numbers from release notes and query GraphQLclosingIssuesReferences. - Post/update an idempotent “shipped in version” comment on linked closed issues using an HTML marker.
- Expand Jest coverage for PR parsing and linked-issue commenting behavior; update docs and bump version.
Show a summary per file
| File | Description |
|---|---|
src/index.js |
Implements PR number parsing, GraphQL lookup of linked issues, and idempotent issue commenting. |
__tests__/index.test.js |
Adds unit/integration tests for PR parsing and linked-issue comment behavior. |
action.yml |
Documents the new comment_on_linked_issues input. |
README.md |
Documents the new input and required issues: write permission. |
package.json |
Version bump for new functionality. |
package-lock.json |
Lockfile version sync with package.json. |
badges/coverage.svg |
Updates coverage badge value. |
Copilot's findings
- Files reviewed: 5/7 changed files
- Comments generated: 1
📦 Draft Release CreatedA draft release v3.1.0 has been created for this PR. Next Steps
|
This was referenced Apr 16, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds opt-in
comment_on_linked_issuesinput that comments on closed issues linked to PRs in the release notes when a release is created.Approach
Instead of regex-based issue parsing (fragile, CodeQL concerns), uses GraphQL
closingIssuesReferencesto find issues linked via the Development sidebar (Fixes #N,Closes #Nkeywords):/pull/NURLs — GitHub's standard format)closingIssuesReferencesKey features
<!-- publish-github-action-release -->marker. Creates comment on first run, updates if version changes on rerun. Never duplicates.github.comURLs. Uses GraphQL and REST APIs only.retryWithBackoff().Changes
src/index.jsparseIssueReferencesregex withparsePullRequestNumbers+ GraphQL. Add idempotent comment posting with marker.__tests__/index.test.jsparsePullRequestNumbers, 11 integration tests for linked issues (create, update, skip open, skip cross-repo, case-insensitive, dedup, disabled, no PRs, GraphQL failure, up-to-date skip, release URL).action.ymlcomment_on_linked_issuesdescription.README.mdissues: writepermission documented.package.json3.0.3→3.1.0.Permissions
Requires
issues: writewhencomment_on_linked_issues: true(documented in README).Tests
73 tests pass. Coverage: 97.24%.