add git deploy key wrapper functionality
This commit is contained in:
parent
73d2440ad4
commit
17860381fc
9 changed files with 88 additions and 8 deletions
9
dist/index.js
vendored
9
dist/index.js
vendored
|
@ -163,6 +163,15 @@ try {
|
|||
console.log("Keys added:");
|
||||
child_process.execSync('ssh-add -l', { stdio: 'inherit' });
|
||||
|
||||
const useGitSSHWrapper = core.getInput('use-git-deploy-key-wrapper');
|
||||
if(useGitSSHWrapper) {
|
||||
const gitSSHWrapperFileName = 'git-deploy-key-wrapper.sh';
|
||||
const gitSSHWrapperPath = path.join(homeSsh, gitSSHWrapperFileName);
|
||||
fs.copyFileSync(path.join(process.cwd(), gitSSHWrapperFileName), gitSSHWrapperPath);
|
||||
fs.chmodSync(gitSSHWrapperPath, "755");
|
||||
|
||||
core.exportVariable('GIT_SSH_COMMAND', gitSSHWrapperPath);
|
||||
}
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue