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:
parent
169acaed93
commit
74af40b44a
2 changed files with 21 additions and 16 deletions
18
lib/index.js
18
lib/index.js
|
@ -447,14 +447,6 @@ function main() {
|
||||||
});
|
});
|
||||||
// files to be created
|
// files to be created
|
||||||
const files = [
|
const files = [
|
||||||
{
|
|
||||||
name: "known_hosts",
|
|
||||||
contents: insertLf(knownHosts, true, true),
|
|
||||||
options: {
|
|
||||||
mode: 0o644,
|
|
||||||
flag: "a",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "config",
|
name: "config",
|
||||||
contents: insertLf(config, true, true),
|
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
|
// create files
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const fileName = path_1.default.join(dirName, file.name);
|
const fileName = path_1.default.join(dirName, file.name);
|
||||||
|
|
19
src/main.ts
19
src/main.ts
|
@ -39,14 +39,6 @@ function main(): void
|
||||||
|
|
||||||
// files to be created
|
// files to be created
|
||||||
const files: FileInfo[] = [
|
const files: FileInfo[] = [
|
||||||
{
|
|
||||||
name: "known_hosts",
|
|
||||||
contents: insertLf(knownHosts, true, true),
|
|
||||||
options: {
|
|
||||||
mode: 0o644,
|
|
||||||
flag: "a",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "config",
|
name: "config",
|
||||||
contents: insertLf(config, true, true),
|
contents: insertLf(config, true, true),
|
||||||
|
@ -67,6 +59,17 @@ function main(): void
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if(!noKnownHosts)
|
||||||
|
{
|
||||||
|
files.push({
|
||||||
|
name: "known_hosts",
|
||||||
|
contents: insertLf(knownHosts, true, true),
|
||||||
|
options: {
|
||||||
|
mode: 0o644,
|
||||||
|
flag: "a",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// create files
|
// create files
|
||||||
for(const file of files)
|
for(const file of files)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue