File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,4 +48,25 @@ if [ "${ACT:-}" = true ]; then
4848 ici_warn " Detected act, bundling industrial_ci"
4949fi
5050
51+ INPUT_SSH_KEY=$( printenv INPUT_SSH-KEY) || true
52+ INPUT_SSH_KNOWN_HOSTS=$( printenv INPUT_SSH-KNOWN-HOSTS) || true
53+
54+ if [ -n " ${INPUT_SSH_KEY:- } " ]; then
55+ # start SSH agent
56+ # shellcheck disable=SC2046
57+ eval $( ssh-agent -s)
58+ # add key to agent
59+ ssh-add <( echo " $INPUT_SSH_KEY " ) || { res=$? ; echo " could not add ssh key" ; exit $res ; }
60+ fi
61+
62+ if [ -n " ${SSH_AUTH_SOCK:- } " ]; then
63+ # setup known hosts
64+ mkdir -p ~ /.ssh
65+ if [ -n " ${INPUT_SSH_KNOWN_HOSTS:- } " ]; then
66+ echo " $INPUT_SSH_KNOWN_HOSTS " >> ~ /.ssh/known_hosts
67+ else
68+ cat /etc/ssh/ssh_known_hosts >> ~ /.ssh/known_hosts
69+ fi
70+ fi
71+
5172env " $@ " bash " $ICI_SRC_PATH /ci_main.sh"
Original file line number Diff line number Diff line change 55 config :
66 description : ' Configuration in JSON format, e.g. from matrix'
77 required : false
8+ ssh-key :
9+ description : ' Entire content of your private SSH key file'
10+ required : false
11+ ssh-known-hosts :
12+ description : ' Addtional entries for the host key database'
13+ required : false
814runs :
915 using : ' node20'
1016 main : ' .github/action.js'
You can’t perform that action at this time.
0 commit comments