fix: Use predictable tag URL for linked issue comments#97
Merged
Conversation
Draft releases have untagged URLs (e.g. /releases/tag/untagged-...) that 404 after publishing. Derive the repo base URL from html_url and construct the permanent /releases/tag/vX.Y.Z URL instead. Draft PR reminder still uses html_url since it intentionally links to the draft for review. Fixes #96
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes linked-issue comments posting a draft “untagged-*” release URL (which later 404s after publishing) by constructing a stable tag-based release URL for those comments.
Changes:
- Build a predictable
/releases/tag/<version>URL for linked-issue comments using the release’shtml_urlto derive the repo base URL. - Add a Jest test ensuring draft “untagged-*” URLs are rewritten to the tag-based URL.
- Update the coverage badge.
Show a summary per file
| File | Description |
|---|---|
src/index.js |
Constructs a stable tag-based release URL for linked issue comments (avoids draft untagged URL). |
__tests__/index.test.js |
Adds regression test validating the rewritten, predictable tag URL is used in issue comments. |
badges/coverage.svg |
Coverage badge refresh. |
Copilot's findings
- Files reviewed: 3/5 changed files
- Comments generated: 2
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.
Fixes #96
Problem
When
create_release_as_draft: true, the linked issue comment includes the draft release URL (e.g.,/releases/tag/untagged-edd26f475091...) which 404s after the release is published.Fix
Derive the repo base URL from
release.data.html_urland construct a predictable tag-based URL (/releases/tag/v1.2.3) instead. This works on both GitHub.com and GHES since no URL is hardcoded.The draft PR reminder comment (
draft_release_pr_reminder) is not changed — it intentionally links to the draft release for review.Changes
src/index.js: Construct predictable release URL for linked issue comments__tests__/index.test.js: Add test verifying draft release URLs are rewritten to tag-based URLs