diff --git a/pkg/scaffold/scaffold_test.go b/pkg/scaffold/scaffold_test.go index 1836806..30e9126 100644 --- a/pkg/scaffold/scaffold_test.go +++ b/pkg/scaffold/scaffold_test.go @@ -15,9 +15,9 @@ import ( const expectedBackendConfig = `terraform { backend "http" { - address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend.git/default" - lock_address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend.git/default" - unlock_address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend.git/default" + address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend/default" + lock_address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend/default" + unlock_address = "https://ffddorf-terraform-backend.fly.dev/state/terraform-backend/default" username = "github_pat" } } diff --git a/pkg/scaffold/tf.go b/pkg/scaffold/tf.go index 69f7f53..fd716f3 100644 --- a/pkg/scaffold/tf.go +++ b/pkg/scaffold/tf.go @@ -97,6 +97,7 @@ func writeBackendConfig(ctx context.Context, dir fs.FS, stdin io.Reader) (reterr return fmt.Errorf("invalid repo path: %s", origin.Path) } repo := segments[1] + repo = strings.TrimSuffix(repo, ".git") backendURL, err := url.Parse(backendAddress) if err != nil {