From 9d0528e7484c31a0ee74bb45edb9ecb3b4297573 Mon Sep 17 00:00:00 2001 From: afonja14755 Date: Fri, 8 Aug 2025 10:45:50 +0300 Subject: [PATCH] fix: encode username --- .changeset/long-stars-tie.md | 5 +++++ src/main.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/long-stars-tie.md diff --git a/.changeset/long-stars-tie.md b/.changeset/long-stars-tie.md new file mode 100644 index 00000000..5db8fbdc --- /dev/null +++ b/.changeset/long-stars-tie.md @@ -0,0 +1,5 @@ +--- +"changesets-gitlab": patch +--- + +fix: encode `username` in URL diff --git a/src/main.ts b/src/main.ts index e830b720..5eabf022 100644 --- a/src/main.ts +++ b/src/main.ts @@ -42,7 +42,7 @@ export const main = async ({ 'remote', 'set-url', 'origin', - `${url.protocol}//${username}:${GITLAB_TOKEN}@${ + `${url.protocol}//${encodeURIComponent(username)}:${GITLAB_TOKEN}@${ url.host }${url.pathname.replace(/\/$/, '')}/${env.CI_PROJECT_PATH}.git`, ],