Skip to content

fix: Use predictable tag URL for linked issue comments#97

Merged
joshjohanning merged 3 commits into
mainfrom
fix/predictable-release-url
Apr 17, 2026
Merged

fix: Use predictable tag URL for linked issue comments#97
joshjohanning merged 3 commits into
mainfrom
fix/predictable-release-url

Conversation

@joshjohanning

Copy link
Copy Markdown
Owner

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_url and 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

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
Copilot AI review requested due to automatic review settings April 17, 2026 19:19
@joshjohanning joshjohanning changed the title Fix: Use predictable tag URL for linked issue comments fix: Use predictable tag URL for linked issue comments Apr 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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’s html_url to 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

Comment thread src/index.js Outdated
Comment thread __tests__/index.test.js
@joshjohanning joshjohanning merged commit cc3f4da into main Apr 17, 2026
4 checks passed
@joshjohanning joshjohanning deleted the fix/predictable-release-url branch April 17, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Draft URL breaks when published

2 participants