changesets / bot

https://github.com/apps/changeset-bot
56 stars 20 forks source link

Github Page Not Found Issue Due to Special Characters in Branch Name(ref) Links #87

Open gwansikk opened 1 month ago

gwansikk commented 1 month ago

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

image

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
image image

How about converting the branch name (context.payload.pull_request.head.ref) using encodeURIComponent? This will ensure that GitHub correctly recognizes it!

encodeURIComponent("feature/#39") // 'feature%2F%2339'
image