more spaghetti at the wall [2]

This commit is contained in:
Demitrious Kelly
2020-03-25 15:28:33 -07:00
parent 034d210969
commit db3b78d8e7
2 changed files with 25 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import fs from 'fs';
import { IActionArguments } from './types';
async function run() {
@@ -8,7 +9,14 @@ async function run() {
try {
await exec.exec(`mkdir -v -p ${process.env['HOME']}/.ssh`);
await exec.exec(`chmod 700 ${process.env['HOME']}/.ssh`);
await exec.exec(`echo "${userArguments.knownHosts}" > ${process.env['HOME']}/.ssh/known_hosts`);
fs.writeFile(
process.env['HOME'] + '/.ssh/known_hosts',
userArguments.knownHosts,
(err) => {
if (err) throw err;
console.log('Wrote ' + process.env['HOME'] + '/.ssh/known_hosts');
}
);
await exec.exec(`chmod 755 ${process.env['HOME']}/.ssh/known_hosts`);
console.log("✅ Configured known_hosts");
} catch( error ) {