Skip to content

fix(forge): encode the tag name in the Bitbucket refs URL - #1269

Merged
BryanFRD merged 1 commit into
mainfrom
fix/bitbucket-tag-path-encoding
Oct 4, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
fix/bitbucket-tag-path-encoding

Conversation

@BryanFRD

@BryanFRD BryanFRD commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Closes #1268

Bitbucket Cloud create_release resolved the tag with /refs/tags/{tag} built from the raw name, so a # or ? coming from a custom tagTemplate cut the URL short and the lookup failed. The tag now goes through the same percent_encode_path as the GitHub ref URL in #1267: / stays, everything outside the unreserved set is encoded, so api@v1.0.0+build#7 becomes api%40v1.0.0%2Bbuild%237, which Bitbucket decodes back to the tag.

A test with that tag checks the encoded path. It fails without the fix.

@BryanFRD
BryanFRD enabled auto-merge (squash) October 4, 2026 17:31

@ferrfleet ferrfleet Bot 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.

Looks correct. percent_encode_path is the same helper github.rs already uses for branch refs, and it leaves / and : unencoded, so a pkg/v1.0.0 tag builds the same URL it did before. The new test covers @, + and #.

Nit: the helper lives in config::loader_js and is shared by two forges now. Moving it into a small neutral module (for example crate::url) would read better, but it doesn't need to happen in this PR.

@BryanFRD
BryanFRD merged commit 1e36f57 into main Oct 4, 2026
32 checks passed
@BryanFRD
BryanFRD deleted the fix/bitbucket-tag-path-encoding branch October 4, 2026 17:33
ferrflow Bot added a commit that referenced this pull request Oct 4, 2026
## [7.27.5] - 2026-10-04

### Bug Fixes

- fix(forge): encode the tag name in the Bitbucket refs URL (#1269)
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.

fix(forge): Bitbucket puts the tag name into the refs URL unencoded

1 participant