When the branch name contains special characters, the hyperlink "Click here if you're a maintainer who wants to add a changeset to this PR" results in a "Page not found" error on GitHub.
Troubleshooting
We use branch names that include the issue number, like this: (feature/#39). However, when using the changeset-bot to generate a changeset.md, it fails because GitHub's URL handling with special characters leads to a "Page not found" error.
❌ feature/#39
✅ feature/%2339
How about converting the branch name (context.payload.pull_request.head.ref) using encodeURIComponent? This will ensure that GitHub correctly recognizes it!
Summary
When the branch name contains special characters, the hyperlink "Click here if you're a maintainer who wants to add a changeset to this PR" results in a "Page not found" error on GitHub.
Troubleshooting
We use branch names that include the issue number, like this: (
feature/#39
). However, when using the changeset-bot to generate achangeset.md
, it fails because GitHub's URL handling with special characters leads to a "Page not found" error.How about converting the branch name (
context.payload.pull_request.head.ref
) usingencodeURIComponent
? This will ensure that GitHub correctly recognizes it!