File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -e
3
+ env_dir=$3
4
+ ssh_key=" $( cat $env_dir /SSH_KEY) "
4
5
5
- echo " -----> Running SSH private key setup"
6
+ if [ " $ssh_key " != " " ]; then
7
+ echo " -----> Running SSH private key setup"
6
8
7
- echo " $SSH_KEY " | base64 --decode > id_rsa
8
- eval ` ssh-agent -s`
9
- ssh-add id_rsa
10
- ssh -oStrictHostKeyChecking=no -T git@github.com || true
11
- rm id_rsa
9
+ echo " $ssh_key " | base64 --decode > id_rsa
10
+ eval ` ssh-agent -s` || exit $?
11
+ ssh-add id_rsa || exit $?
12
+ ssh -oStrictHostKeyChecking=no -T git@github.com
13
+ rm id_rsa
14
+ else
15
+ echo " -----> No SSH private key"
16
+ fi
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- if [ -z " $SSH_KEY " ]; then
4
- echo " no"
5
- exit 1
6
- else
7
- echo " SSH private key"
8
- exit 0
9
- fi
3
+ echo " SSH private key"
4
+ exit 0
You can’t perform that action at this time.
0 commit comments