Change the identify file path from hardcoded absolute to user based

## Issue

The issue is that a hardcoded full path is in a github action something like `/home/runner` if you need that file inside of a docker build system you can not simply mount that file into the container. You need to copy the file, sed it (string replace) and then mount it.

If we would use something like a "home dir" placeholder this would work out of the box.

Not sure if ~ works in all cases but %d should.

https://linux.die.net/man/5/ssh_config
This commit is contained in:
Julian Hille 2025-09-19 09:33:17 +02:00 committed by GitHub
parent a6f90b1f12
commit 76b9e14124
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,7 +66,7 @@ try {
const sshConfig = `\nHost key-${sha256}.github.com\n` const sshConfig = `\nHost key-${sha256}.github.com\n`
+ ` HostName github.com\n` + ` HostName github.com\n`
+ ` IdentityFile ${homeSsh}/key-${sha256}\n` + ` IdentityFile ~/.ssh/key-${sha256}\n`
+ ` IdentitiesOnly yes\n`; + ` IdentitiesOnly yes\n`;
fs.appendFileSync(`${homeSsh}/config`, sshConfig); fs.appendFileSync(`${homeSsh}/config`, sshConfig);