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:
parent
7b68ee8c33
commit
0673b3776f
4 changed files with 35 additions and 0 deletions
24
.github/workflows/verify-on-ubuntu.yml
vendored
24
.github/workflows/verify-on-ubuntu.yml
vendored
|
@ -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
|
||||||
|
|
|
@ -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"
|
||||||
|
|
|
@ -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");
|
||||||
|
|
|
@ -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");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue