From 21c2608681e1d66c9e33fd5641be6949a4bc458e Mon Sep 17 00:00:00 2001 From: djarbz <30350993+djarbz@users.noreply.github.com> Date: Sat, 28 Sep 2024 18:12:34 -0500 Subject: [PATCH 1/3] Update main.tf Add Github and Gitlab when using git@ URLs. --- git-clone/main.tf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git-clone/main.tf b/git-clone/main.tf index 0295444..f068810 100644 --- a/git-clone/main.tf +++ b/git-clone/main.tf @@ -34,9 +34,15 @@ variable "git_providers" { "https://github.com/" = { provider = "github" }, + "git@github.com:" = { + provider = "github" + }, "https://gitlab.com/" = { provider = "gitlab" }, + "git@gitlab.com:" = { + provider = "gitlab" + }, } validation { error_message = "Allowed values for provider are \"github\" or \"gitlab\"." From 96c8b73f47c069d4ed29fe4b415523884160879c Mon Sep 17 00:00:00 2001 From: djarbz <30350993+djarbz@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:24:16 -0500 Subject: [PATCH 2/3] Update main.test.ts Expect git@github.com: to return provider of github --- git-clone/main.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-clone/main.test.ts b/git-clone/main.test.ts index 9fbd202..627fb8a 100644 --- a/git-clone/main.test.ts +++ b/git-clone/main.test.ts @@ -72,7 +72,7 @@ describe("git-clone", async () => { url, }); expect(state.outputs.repo_dir.value).toEqual("/tmp/coder"); - expect(state.outputs.git_provider.value).toEqual(""); + expect(state.outputs.git_provider.value).toEqual("github"); expect(state.outputs.clone_url.value).toEqual(url); const https_url = "https://github.com/coder/coder.git"; expect(state.outputs.web_url.value).toEqual(https_url); From 11a4f6cf14de3c45ff5c809b40fc8a72493f93b1 Mon Sep 17 00:00:00 2001 From: djarbz <30350993+djarbz@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:28:00 -0500 Subject: [PATCH 3/3] Update README.md Bump version numbers --- git-clone/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/git-clone/README.md b/git-clone/README.md index 6b8871e..5b40dc5 100644 --- a/git-clone/README.md +++ b/git-clone/README.md @@ -14,7 +14,7 @@ This module allows you to automatically clone a repository by URL and skip if it ```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id url = "https://github.com/coder/coder" } @@ -27,7 +27,7 @@ module "git-clone" { ```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id url = "https://github.com/coder/coder" base_dir = "~/projects/coder" @@ -41,7 +41,7 @@ To use with [Git Authentication](https://coder.com/docs/v2/latest/admin/git-prov ```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id url = "https://github.com/coder/coder" } @@ -66,7 +66,7 @@ data "coder_parameter" "git_repo" { # Clone the repository for branch `feat/example` module "git_clone" { source = "registry.coder.com/modules/git-clone/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id url = data.coder_parameter.git_repo.value } @@ -74,7 +74,7 @@ module "git_clone" { # Create a code-server instance for the cloned repository module "code-server" { source = "registry.coder.com/modules/code-server/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id order = 1 folder = "/home/${local.username}/${module.git_clone.folder_name}" @@ -98,7 +98,7 @@ Configuring `git-clone` for a self-hosted GitHub Enterprise Server running at `g ```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id url = "https://github.example.com/coder/coder/tree/feat/example" git_providers = { @@ -116,7 +116,7 @@ To GitLab clone with a specific branch like `feat/example` ```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id url = "https://gitlab.com/coder/coder/-/tree/feat/example" } @@ -127,7 +127,7 @@ Configuring `git-clone` for a self-hosted GitLab running at `gitlab.example.com` ```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id url = "https://gitlab.example.com/coder/coder/-/tree/feat/example" git_providers = { @@ -147,7 +147,7 @@ For example, to clone the `feat/example` branch: ```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id url = "https://github.com/coder/coder" branch_name = "feat/example" @@ -163,7 +163,7 @@ For example, this will clone into the `~/projects/coder/coder-dev` folder: ```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" - version = "1.0.18" + version = "1.0.20" agent_id = coder_agent.example.id url = "https://github.com/coder/coder" folder_name = "coder-dev"