File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ branding:
77
88inputs :
99 host :
10- description : Hostname of the SSH server
10+ description : Hostname of the SSH server. Multiple hosts can be provided as a multiline string.
1111 required : false
1212 private-key :
13- description : PEM-encoded SSH private key for pulling the Shipyard registry index
13+ description : PEM-encoded SSH private key for pulling the Shipyard registry index. Multiple keys can be provided as a multiline string.
1414 required : true
1515
1616runs :
@@ -20,10 +20,18 @@ runs:
2020 with :
2121 ssh-private-key : ${{ inputs.private-key }}
2222
23- - name : Add host key to .ssh/known_hosts
23+ - name : Ensure .ssh/known_hosts exists
2424 shell : bash
2525 if : inputs.host
2626 run : |
2727 mkdir -p ~/.ssh
2828 touch ~/.ssh/known_hosts
29- ssh-keyscan ${{ inputs.host }} >> ~/.ssh/known_hosts
29+
30+ - name : Add host key(s) to .ssh/known_hosts
31+ shell : bash
32+ if : inputs.host
33+ run : |
34+ IFS=$'\n' hosts=(${{ inputs.host }})
35+ for host in "${hosts[@]}"; do
36+ ssh-keyscan $host >> ~/.ssh/known_hosts
37+ done
You can’t perform that action at this time.
0 commit comments