This commit is contained in:
Demitrious Kelly 2020-03-25 15:03:56 -07:00
parent 9315d47124
commit 2863e02eda
2 changed files with 22 additions and 8 deletions

16
dist/index.js vendored
View File

@ -666,10 +666,18 @@ function run() {
return __awaiter(this, void 0, void 0, function* () {
const userArguments = getUserArguments();
if ('' !== userArguments.knownHosts) {
yield exec.exec(`mkdir -p /home/runner/.ssh`);
yield exec.exec(`chmod 0700 /home/runner/.ssh`);
yield exec.exec(`echo ${userArguments.knownHosts} > /home/runner/.ssh/known_hosts`);
yield exec.exec(`chmod 0700 /home/runner/.ssh/known_hosts`);
try {
yield exec.exec(`mkdir -v -p $HOME/.ssh`);
yield exec.exec(`chmod 700 $HOME/.ssh`);
yield exec.exec(`echo ${userArguments.knownHosts} > $HOME/.ssh/known_hosts`);
yield exec.exec(`chmod 755 $HOME/.ssh/known_hosts`);
console.log("✅ Configured known_hosts");
}
catch (error) {
console.error("⚠️ Error configuring known_hosts");
core.setFailed(error.message);
;
}
}
try {
yield syncFiles(userArguments);

View File

@ -5,10 +5,16 @@ import { IActionArguments } from './types';
async function run() {
const userArguments = getUserArguments();
if ( '' !== userArguments.knownHosts ) {
await exec.exec(`mkdir -p /home/runner/.ssh`);
await exec.exec(`chmod 0700 /home/runner/.ssh`);
await exec.exec(`echo ${userArguments.knownHosts} > /home/runner/.ssh/known_hosts`);
await exec.exec(`chmod 0700 /home/runner/.ssh/known_hosts`);
try {
await exec.exec(`mkdir -v -p $HOME/.ssh`);
await exec.exec(`chmod 700 $HOME/.ssh`);
await exec.exec(`echo ${userArguments.knownHosts} > $HOME/.ssh/known_hosts`);
await exec.exec(`chmod 755 $HOME/.ssh/known_hosts`);
console.log("✅ Configured known_hosts");
} catch( error ) {
console.error("⚠️ Error configuring known_hosts")
core.setFailed(error.message);;
}
}
try {
await syncFiles(userArguments);