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

* append to "config" and "known_hosts" instead of overwriting

This commit is contained in:
shimataro 2019-12-29 17:43:56 +09:00
parent 3e015c8816
commit 15a66833ef
No known key found for this signature in database
GPG key ID: BE92C05736911A9D
3 changed files with 12 additions and 1 deletions

View file

@ -20,21 +20,25 @@ function main() {
{
name: name,
mode: 0o400,
flag: "w",
contents: core.getInput("private-key"),
},
{
name: `${name}.pub`,
mode: 0o444,
flag: "w",
contents: core.getInput("public-key"),
},
{
name: "known_hosts",
mode: 0o644,
flag: "a",
contents: core.getInput("known-hosts"),
},
{
name: "config",
mode: 0o644,
flag: "a",
contents: core.getInput("config"),
},
];
@ -50,6 +54,7 @@ function main() {
const fileName = path.join(dirName, file.name);
fs.writeFileSync(fileName, file.contents, {
mode: file.mode,
flag: file.flag,
});
}
console.log(`SSH key has been stored to ${dirName} successfully.`);