Execute piped command and deploy command generation
This commit is contained in:
parent
8dc32f57e9
commit
8a45006880
7
dist/index.js
vendored
7
dist/index.js
vendored
@ -85,9 +85,10 @@ function main() {
|
||||
const sshKey = core.getInput('ssh-key', { required: true });
|
||||
core.info(`sshKey: ${sshKey.length}`);
|
||||
fs.writeFileSync('ssh_key', sshKey, { flag: 'w+', mode: "0600" });
|
||||
const result = yield exec.getExecOutput('cat', ['ssh_key']);
|
||||
const sshKeyContents = result.stdout;
|
||||
core.info(`sshKeyContents: ${sshKeyContents.length}`);
|
||||
const pipedCommand = `pwd | ls`;
|
||||
yield exec.exec('sh', ['-c', `${pipedCommand}`]);
|
||||
const deployCommand = `echo "${gitea.context.serverUrl}/${gitea.context.repo.owner}/${gitea.context.repo.repo}.git ${process.env.GITHUB_REF_NAME}"`;
|
||||
core.info(deployCommand);
|
||||
});
|
||||
}
|
||||
main().catch(handleError);
|
||||
|
@ -52,9 +52,11 @@ async function main() {
|
||||
core.info(`sshKey: ${sshKey.length}`);
|
||||
fs.writeFileSync('ssh_key', sshKey, {flag: 'w+', mode: "0600"});
|
||||
|
||||
const result = await exec.getExecOutput('cat', ['ssh_key']);
|
||||
const sshKeyContents = result.stdout;
|
||||
core.info(`sshKeyContents: ${sshKeyContents.length}`);
|
||||
const pipedCommand = `pwd | ls`;
|
||||
await exec.exec('sh', ['-c', `${pipedCommand}`]);
|
||||
|
||||
const deployCommand = `echo "${gitea.context.serverUrl}/${gitea.context.repo.owner}/${gitea.context.repo.repo}.git ${process.env.GITHUB_REF_NAME}"`;
|
||||
core.info(deployCommand);
|
||||
}
|
||||
|
||||
main().catch(handleError);
|
||||
|
Loading…
x
Reference in New Issue
Block a user