Skip to content

Commit 5d189a5

Browse files
committed
fix: encode username
1 parent 85b28f7 commit 5d189a5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/long-stars-tie.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"changesets-gitlab": patch
3+
---
4+
5+
fix encode username

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ export const main = async ({
3535

3636
console.log('setting GitLab credentials')
3737
const username = await getUsername(createApi())
38+
const safeUsername = encodeURIComponent(username)
3839

3940
await exec(
4041
'git',
4142
[
4243
'remote',
4344
'set-url',
4445
'origin',
45-
`${url.protocol}//${username}:${GITLAB_TOKEN}@${
46+
`${url.protocol}//${safeUsername}:${GITLAB_TOKEN}@${
4647
url.host
4748
}${url.pathname.replace(/\/$/, '')}/${env.CI_PROJECT_PATH}.git`,
4849
],

0 commit comments

Comments
 (0)