mirror of
https://github.com/SamKirkland/FTP-Deploy-Action.git
synced 2025-08-14 22:15:05 +00:00
home?
This commit is contained in:
parent
9315d47124
commit
2863e02eda
16
dist/index.js
vendored
16
dist/index.js
vendored
@ -666,10 +666,18 @@ function run() {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const userArguments = getUserArguments();
|
const userArguments = getUserArguments();
|
||||||
if ('' !== userArguments.knownHosts) {
|
if ('' !== userArguments.knownHosts) {
|
||||||
yield exec.exec(`mkdir -p /home/runner/.ssh`);
|
try {
|
||||||
yield exec.exec(`chmod 0700 /home/runner/.ssh`);
|
yield exec.exec(`mkdir -v -p $HOME/.ssh`);
|
||||||
yield exec.exec(`echo ${userArguments.knownHosts} > /home/runner/.ssh/known_hosts`);
|
yield exec.exec(`chmod 700 $HOME/.ssh`);
|
||||||
yield exec.exec(`chmod 0700 /home/runner/.ssh/known_hosts`);
|
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 {
|
try {
|
||||||
yield syncFiles(userArguments);
|
yield syncFiles(userArguments);
|
||||||
|
14
src/main.ts
14
src/main.ts
@ -5,10 +5,16 @@ import { IActionArguments } from './types';
|
|||||||
async function run() {
|
async function run() {
|
||||||
const userArguments = getUserArguments();
|
const userArguments = getUserArguments();
|
||||||
if ( '' !== userArguments.knownHosts ) {
|
if ( '' !== userArguments.knownHosts ) {
|
||||||
await exec.exec(`mkdir -p /home/runner/.ssh`);
|
try {
|
||||||
await exec.exec(`chmod 0700 /home/runner/.ssh`);
|
await exec.exec(`mkdir -v -p $HOME/.ssh`);
|
||||||
await exec.exec(`echo ${userArguments.knownHosts} > /home/runner/.ssh/known_hosts`);
|
await exec.exec(`chmod 700 $HOME/.ssh`);
|
||||||
await exec.exec(`chmod 0700 /home/runner/.ssh/known_hosts`);
|
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 {
|
try {
|
||||||
await syncFiles(userArguments);
|
await syncFiles(userArguments);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user