mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
Feature/no known hosts (#181)
* add "if_key_exists" * add test * fix flag * fix SSH connection commands * add test for if_key_exists=ignore * add test for if_key_exists=fail * add tests to Windows / macOS * update CHANGELOG * update badges * update README * fix README * update README * test no_known_hosts parameter * implement * ignore known_hosts if no_known_hosts is true * refactor * no_known_hosts is false * Revert "no_known_hosts is false" This reverts commit206d310c5c
. * test on Windows / macOS * test on Docker containers * add tests for Docker containers * test no_known_hosts parameter * implement * ignore known_hosts if no_known_hosts is true * refactor * no_known_hosts is false * Revert "no_known_hosts is false" This reverts commit206d310c5c
. * test on Windows / macOS * test on Docker containers * use `known_hosts: no` instead of `no_known_hosts: true` * update README * update README * "known_hosts: no" -> "known_hosts: unnecessary" * update README * update README * update CHANGELOG
This commit is contained in:
parent
f8aa6610de
commit
954c620b17
10 changed files with 208 additions and 37 deletions
39
lib/index.js
39
lib/index.js
|
@ -445,24 +445,7 @@ function main() {
|
|||
mode: 0o700,
|
||||
});
|
||||
// files to be created
|
||||
const files = [
|
||||
{
|
||||
name: "known_hosts",
|
||||
contents: insertLf(knownHosts, true, true),
|
||||
options: {
|
||||
mode: 0o644,
|
||||
flag: "a",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "config",
|
||||
contents: insertLf(config, true, true),
|
||||
options: {
|
||||
mode: 0o644,
|
||||
flag: "a",
|
||||
},
|
||||
},
|
||||
];
|
||||
const files = [];
|
||||
if (shouldCreateKeyFile(path_1.default.join(dirName, name), ifKeyExists)) {
|
||||
files.push({
|
||||
name: name,
|
||||
|
@ -473,6 +456,26 @@ function main() {
|
|||
},
|
||||
});
|
||||
}
|
||||
if (knownHosts !== "unnecessary") {
|
||||
files.push({
|
||||
name: "known_hosts",
|
||||
contents: insertLf(knownHosts, true, true),
|
||||
options: {
|
||||
mode: 0o644,
|
||||
flag: "a",
|
||||
},
|
||||
});
|
||||
}
|
||||
if (config !== "") {
|
||||
files.push({
|
||||
name: "config",
|
||||
contents: insertLf(config, true, true),
|
||||
options: {
|
||||
mode: 0o644,
|
||||
flag: "a",
|
||||
},
|
||||
});
|
||||
}
|
||||
// create files
|
||||
for (const file of files) {
|
||||
const fileName = path_1.default.join(dirName, file.name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue