From ded5bc2c883d6b52bc5bfa55acbeb0005fd5b189 Mon Sep 17 00:00:00 2001 From: Andrew Lisowski Date: Thu, 3 Jan 2019 20:08:58 -0500 Subject: [PATCH] Changes the verbose logging so that it doesn't leak tokens --- src/github-release.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/github-release.ts b/src/github-release.ts index 0f99e2697..caf3dff50 100644 --- a/src/github-release.ts +++ b/src/github-release.ts @@ -129,7 +129,18 @@ export default class GitHubRelease { args.baseUrl = this.githubApi; } - this.logger.verbose.info('Initializing GitHub API with:\n', args); + // So that --verbose can be used on public CIs + const tokenlessArgs = { + ...args, + token: args.token + ? `[Token starting with ${args.token.substring(0, 4)}]` + : undefined + }; + + this.logger.verbose.info( + 'Initializing GitHub API with:\n', + tokenlessArgs + ); this.github = Promise.resolve(new GitHub(args)); } else { this.logger.verbose.info('Getting repo information from package.json');