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
41
src/main.ts
41
src/main.ts
|
@ -37,24 +37,7 @@ function main(): void
|
|||
});
|
||||
|
||||
// files to be created
|
||||
const files: FileInfo[] = [
|
||||
{
|
||||
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: FileInfo[] = [];
|
||||
if(shouldCreateKeyFile(path.join(dirName, name), ifKeyExists))
|
||||
{
|
||||
files.push({
|
||||
|
@ -66,6 +49,28 @@ function main(): void
|
|||
},
|
||||
});
|
||||
}
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue