Skip to content

Commit

Permalink
Merge pull request #14 from PiJaAB/feat/w12
Browse files Browse the repository at this point in the history
feat/try-without-splitting-string-input
  • Loading branch information
Gökhan Alkacir authored Sep 25, 2023
2 parents e82e984 + 886c27b commit fc568a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export async function run(): Promise<void> {
const sshKey: string = core.getInput(PRIVATE_SSH_KEY).trim()
const userEmail: string = core.getInput(USER_EMAIL).trim()

child_process.execFile
// Extract auth socket path and agent pid and set them as job variables
child_process
.execFileSync('ssh-agent', [])
Expand All @@ -64,14 +65,14 @@ export async function run(): Promise<void> {
// fs.writeFileSync(SSH_KEY_PATH, sshKey, { mode: "600" })
fs.appendFileSync(SSH_CONFIG_PATH, SSH_CONFIG)

sshKey.split(/(?=-----BEGIN)/).forEach(function (key) {
child_process.execFileSync('ssh-add', ['-'], {
input: key.trim() + '\n'
})
fs.writeFileSync(`${SSH_KEY_PATH}`, sshKey, {
mode: '600'
})
// sshKey.split(/(?=-----BEGIN)/).forEach(function (key) {
child_process.execFileSync('ssh-add', ['-'], {
input: sshKey
})
fs.writeFileSync(`${SSH_KEY_PATH}`, sshKey, {
mode: '600'
})
// })

await exec.exec(`ssh-keyscan github.com >> ${SSH_HOME_DIR}/known_hosts`)

Expand Down

0 comments on commit fc568a2

Please sign in to comment.