Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ function getUrlAuth(url, user, password): string | undefined {
if (!url) return
const protocol = getProtocol(url)
const [_, bareUrl] = url.split('://')
return protocol === 'file' ? `${protocol}://${bareUrl}` : `${protocol}://${user}:${password}@${bareUrl}`
const encodedUser = encodeURIComponent(user as string)
const encodedPassword = encodeURIComponent(password as string)
return protocol === 'file' ? `${protocol}://${bareUrl}` : `${protocol}://${encodedUser}:${encodedPassword}@${bareUrl}`
}

const secretFileRegex = new RegExp(`^(.*/)?secrets.*.yaml(.dec)?$`)
Expand Down
4 changes: 3 additions & 1 deletion src/utils/workloadUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export async function fetchWorkloadCatalog(
let gitUrl = url
if (isGiteaURL(url)) {
const [protocol, bareUrl] = url.split('://')
gitUrl = `${protocol}://${process.env.GIT_USER}:${process.env.GIT_PASSWORD}@${bareUrl}`
const encodedUser = encodeURIComponent(process.env.GIT_USER as string)
const encodedPassword = encodeURIComponent(process.env.GIT_PASSWORD as string)
gitUrl = `${protocol}://${encodedUser}:${encodedPassword}@${bareUrl}`
}
shell.exec(`git clone --depth 1 ${gitUrl} ${helmChartsDir}`)
const files = await readdir(`${helmChartsDir}`, 'utf-8')
Expand Down