Skip to content

Commit ef5d89b

Browse files
committed
fix: replace username and password from git related logs
1 parent 830b5b2 commit ef5d89b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/cmd/commit.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ const commitAndPush = async (values: Record<string, any>, branch: string): Promi
4646
}
4747
await $`git commit -m ${message} --no-verify`
4848
} catch (e) {
49-
d.log(e)
49+
const { username, password } = getRepo(values)
50+
d.log('commit and push error:', e.replace(password, '****').replace(username, '****'))
5051
return
5152
}
5253
if (values._derived?.untrustedCA) process.env.GIT_SSL_NO_VERIFY = '1'
@@ -127,7 +128,7 @@ export const cloneOtomiChartsInGitea = async (): Promise<void> => {
127128
await $`git config http.sslVerify false`
128129
await $`git push -u origin main`
129130
} catch (error) {
130-
d.info('CloneOtomiChartsInGitea Error:', error)
131+
d.info('CloneOtomiChartsInGitea Error:', error.replace(password, '****').replace(username, '****'))
131132
}
132133
d.info('Cloned apl-charts in Gitea')
133134
}

src/common/bootstrap.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const bootstrapGit = async (inValues?: Record<string, any>): Promise<void
2222
const d = terminal(`cmd:${cmdName}:bootstrapGit`)
2323
// inValues indicates that there is no values repo file structure that helmfile expects
2424
const values = inValues ?? ((await hfValues()) as Record<string, any>)
25-
const { remote, branch, email, username } = getRepo(values)
25+
const { remote, branch, email, username, password } = getRepo(values)
2626
cd(env.ENV_DIR)
2727
if (await pathExists(`${env.ENV_DIR}/.git`)) {
2828
d.info(`Git repo was already bootstrapped, setting identity just in case`)
@@ -57,7 +57,7 @@ export const bootstrapGit = async (inValues?: Record<string, any>): Promise<void
5757
// decrypt the freshly cloned repo
5858
await decrypt()
5959
} catch (e) {
60-
d.debug(e)
60+
d.debug(e.replace(password, '****').replace(username, '****'))
6161
d.info('Remote does not exist yet. Expecting first commit to come later.')
6262
} finally {
6363
const defaultValues = (await hfValues({ defaultValues: true })) as Record<string, any>

0 commit comments

Comments
 (0)