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:
parent
3e015c8816
commit
15a66833ef
3 changed files with 12 additions and 1 deletions
|
@ -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.`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue