Skip to content

Commit 62b04ff

Browse files
committed
ci: remove credentials (and log)
1 parent d28e465 commit 62b04ff

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

scripts/snapshots.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ function _copy(from: string, to: string) {
3232

3333

3434
function _exec(command: string, args: string[], opts: { cwd?: string }, logger: logging.Logger) {
35-
logger.debug(`Running command ${JSON.stringify(command)} ${
36-
args.map(x => JSON.stringify(x)).join(' ')}...`);
3735
const { stdout, stderr, status, error } = spawnSync(command, args, { ...opts });
3836

3937
if (stderr.length) {
@@ -78,9 +76,6 @@ export default function(opts: SnapshotsOptions, logger: logging.Logger) {
7876
_exec('git', ['config', '--global', 'push.default', 'simple'], {}, logger);
7977
}
8078

81-
const gitCredentials = path.join(process.env['HOME'], '.git-credentials');
82-
fs.writeFileSync(gitCredentials, `https://${githubToken}@github.com`);
83-
8479
// Run build.
8580
logger.info('Building...');
8681
build({ snapshot: true }, logger.createChild('build'));
@@ -98,16 +93,14 @@ export default function(opts: SnapshotsOptions, logger: logging.Logger) {
9893
const publishLogger = logger.createChild('publish');
9994
publishLogger.debug('Temporary directory: ' + root);
10095

101-
const url = `https://github.com/${pkg.snapshotRepo}.git`;
96+
const url = `https://${githubToken ? githubToken + '@' : ''}github.com/${pkg.snapshotRepo}.git`;
10297
_exec('git', ['clone', url], { cwd: root }, publishLogger);
10398

10499
const destPath = path.join(root, path.basename(pkg.snapshotRepo));
105100
_copy(pkg.dist, destPath);
106101

107102
if (githubToken) {
108103
_exec('git', ['config', 'commit.gpgSign', 'false'], { cwd: destPath }, publishLogger);
109-
_exec('git', ['config', 'credential.helper', `store --file="${gitCredentials}"`],
110-
{ cwd: destPath }, publishLogger);
111104
}
112105

113106
// Make sure that every snapshots is unique.

0 commit comments

Comments
 (0)