Skip to content

Commit 5808dd6

Browse files
JAN-1120: Don't fail the pipeline if we cannot setup SSH
1 parent a41566e commit 5808dd6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ssh.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import os from 'os';
66
* This function copies the SSH identity file and known hosts file from the Bitbucket Pipelines agent to the local .ssh directory.
77
* It also updates the SSH configuration file to include the identity file.
88
*
9-
* @throws {Error} If the SSH identity file cannot be copied or the SSH configuration file cannot be updated.
9+
* @returns {Promise<void>} Resolves when the SSH credentials are setup or we fail to update the SSH configuration file (which doesn't fail the pipeline)
1010
*/
1111
export async function setupSshCredentials(): Promise<void> {
1212
const homeDir = os.homedir();
@@ -42,7 +42,7 @@ export async function setupSshCredentials(): Promise<void> {
4242
console.error(
4343
'Failed to update SSH configuration, check that SSH key configuration in Pipelines is valid. \n Check Pipelines -> SSH Keys.'
4444
);
45-
throw e;
45+
return;
4646
}
4747

4848
// Copy over the known_hosts file that Bitbucket generated
@@ -57,7 +57,7 @@ export async function setupSshCredentials(): Promise<void> {
5757
console.error(
5858
'Failed to update hosts file. \n Check Pipelines configuration for known hosts.'
5959
);
60-
throw e;
60+
return;
6161
}
6262

6363
console.log('Updating SSH directory permissions');

0 commit comments

Comments
 (0)