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

ignore known_hosts if no_known_hosts is true

This commit is contained in:
shimataro 2021-03-08 17:53:38 +09:00
parent 169acaed93
commit 74af40b44a
No known key found for this signature in database
GPG key ID: BE92C05736911A9D
2 changed files with 21 additions and 16 deletions

View file

@ -447,14 +447,6 @@ function main() {
});
// 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),
@ -474,6 +466,16 @@ function main() {
},
});
}
if (!noKnownHosts) {
files.push({
name: "known_hosts",
contents: insertLf(knownHosts, true, true),
options: {
mode: 0o644,
flag: "a",
},
});
}
// create files
for (const file of files) {
const fileName = path_1.default.join(dirName, file.name);