0
0
Fork 0
mirror of https://github.com/actions/checkout.git synced 2025-04-29 04:19:21 +03:00

add ssh support ()

This commit is contained in:
eric sciple 2020-03-11 15:55:17 -04:00 committed by GitHub
parent 80602fafba
commit b2e6b7ed13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 837 additions and 58 deletions

View file

@ -18,9 +18,13 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
core.info(
`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`
)
const repositoryUrl = `https://${hostname}/${encodeURIComponent(
settings.repositoryOwner
)}/${encodeURIComponent(settings.repositoryName)}`
const repositoryUrl = settings.sshKey
? `git@${hostname}:${encodeURIComponent(
settings.repositoryOwner
)}/${encodeURIComponent(settings.repositoryName)}.git`
: `https://${hostname}/${encodeURIComponent(
settings.repositoryOwner
)}/${encodeURIComponent(settings.repositoryName)}`
// Remove conflicting file path
if (fsHelper.fileExistsSync(settings.repositoryPath)) {