Skip to content

Commit

Permalink
fix(git): Add a newline to the SSH private key (#34674)
Browse files Browse the repository at this point in the history
Co-authored-by: Rhys Arkins <[email protected]>
  • Loading branch information
hkraal and rarkins authored Mar 9, 2025
1 parent 50c09b1 commit d0fb3b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/git/private-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class SSHKey extends PrivateKey {
if (await this.hasPassphrase(keyFileName)) {
throw new Error('SSH key must have an empty passhprase');
}
await fs.outputFile(keyFileName, this.key);
await fs.outputFile(keyFileName, this.key.replace(/\n?$/, '\n'));
process.on('exit', () => fs.removeSync(keyFileName));
await fs.chmod(keyFileName, 0o600);
// HACK: `git` calls `ssh-keygen -Y sign ...` internally for SSH-based
Expand Down

0 comments on commit d0fb3b7

Please sign in to comment.