1
0
Fork 0
mirror of https://github.com/shimataro/ssh-key-action.git synced 2025-06-19 22:52:10 +10:00

test no_known_hosts parameter

This commit is contained in:
shimataro 2021-03-08 17:09:37 +09:00
parent be34738386
commit 9ce25420b4
No known key found for this signature in database
GPG key ID: BE92C05736911A9D
4 changed files with 35 additions and 0 deletions

View file

@ -257,3 +257,27 @@ jobs:
run: ls -l ~/.ssh run: ls -l ~/.ssh
- name: git clone through SSH - name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp run: git clone git@github.com:shimataro/ssh-key-action.git tmp
no_known_hosts:
name: no known_hosts file
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-16.04
- ubuntu-18.04
- ubuntu-20.04
steps:
- name: Checkout source codes
uses: actions/checkout@v2
- name: Install SSH key
uses: ./.
with:
key: ${{ secrets.SSH_KEY_PEM }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
no_known_hosts: true
- name: print created files
run: ls -l ~/.ssh
- name: git clone through SSH
run: git clone git@github.com:shimataro/ssh-key-action.git tmp

View file

@ -25,6 +25,10 @@ inputs:
description: "replace / ignore / fail" description: "replace / ignore / fail"
required: false required: false
default: "fail" default: "fail"
no_known_hosts:
description: "enables not providing known_hosts file"
required: false
default: "0"
runs: runs:
using: "node12" using: "node12"
main: "lib/index.js" main: "lib/index.js"

View file

@ -437,6 +437,9 @@ function main() {
}); });
const config = core.getInput("config"); const config = core.getInput("config");
const ifKeyExists = core.getInput("if_key_exists"); const ifKeyExists = core.getInput("if_key_exists");
// test
const noKnownHosts = core.getInput("no_known_hosts");
console.log(noKnownHosts);
// create ".ssh" directory // create ".ssh" directory
const home = getHomeDirectory(); const home = getHomeDirectory();
const dirName = path_1.default.resolve(home, ".ssh"); const dirName = path_1.default.resolve(home, ".ssh");

View file

@ -28,6 +28,10 @@ function main(): void
const config = core.getInput("config"); const config = core.getInput("config");
const ifKeyExists = core.getInput("if_key_exists"); const ifKeyExists = core.getInput("if_key_exists");
// test
const noKnownHosts = core.getInput("no_known_hosts");
console.log(noKnownHosts);
// create ".ssh" directory // create ".ssh" directory
const home = getHomeDirectory(); const home = getHomeDirectory();
const dirName = path.resolve(home, ".ssh"); const dirName = path.resolve(home, ".ssh");