Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src/git-source-provider.ts
diff options
context:
space:
mode:
authoreric sciple <ericsciple@users.noreply.github.com>2020-03-11 15:55:17 -0400
committerGitHub <noreply@github.com>2020-03-11 15:55:17 -0400
commit1b406b27feed694fb3a05a638c92124514baa6ea (patch)
tree05a8d7cd5c1748d2e83782e43edb2c274882ea90 /src/git-source-provider.ts
parentad8315eb967265115b59c3b9dc1516f8ac5917ba (diff)
add ssh support (#163)
Diffstat (limited to 'src/git-source-provider.ts')
-rw-r--r--src/git-source-provider.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/git-source-provider.ts b/src/git-source-provider.ts
index 90f97c9..7ce9fb7 100644
--- a/src/git-source-provider.ts
+++ b/src/git-source-provider.ts
@@ -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)) {