Skip to content

Commit

Permalink
fixing reponame (#15)
Browse files Browse the repository at this point in the history
Co-authored-by: V814091 <[email protected]>
  • Loading branch information
Pacobart and V814091 authored Nov 8, 2023
1 parent 912c84a commit 4aa0502
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/hcl/hcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func GenerateHCLTFVars(workspaces []tfworkspaces.Workspace) *hclwrite.File {
variableSetName = ws.VariableSets[0].Attributes.Name
}

workspaceBody.SetAttributeValue("reponame", cty.StringVal(ws.Attributes.Name))
workspaceBody.SetAttributeValue("reponame", cty.StringVal(ws.Attributes.VcsRepo.Identifier))
workspaceBody.SetAttributeValue("description", cty.StringVal(ws.Attributes.Description))
workspaceBody.SetAttributeValue("branchname", cty.StringVal(ws.Attributes.VcsRepo.Branch))
workspaceBody.SetAttributeValue("agent", cty.StringVal(ws.Relationships.AgentPool.Data.Name))
Expand Down
4 changes: 2 additions & 2 deletions internal/hcl/hcl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestGenerateHCLTFVars(t *testing.T) {
workspace.Attributes.Name = "my-workspace"
workspace.Attributes.Description = "My awesome workspace"
workspace.Attributes.VcsRepo.Branch = "main"
workspace.Attributes.VcsRepo.Identifier = "https://github.com/Pacobart/terraform-cloud-workspace-collector.git"
workspace.Attributes.VcsRepo.Identifier = "Pacobart/terraform-cloud-workspace-collector"
workspace.Relationships.Organization.Data.ID = "org-tv9993939393fupk"
workspace.Relationships.AgentPool.Data.Id = "agent-pool10x"
workspace.Relationships.AgentPool.Data.Name = "pool10x"
Expand All @@ -29,7 +29,7 @@ func TestGenerateHCLTFVars(t *testing.T) {

wantString := `workspaces = {
my-workspace = {
reponame = "my-workspace"
reponame = "Pacobart/terraform-cloud-workspace-collector"
description = "My awesome workspace"
branchname = "main"
agent = "pool10x"
Expand Down

0 comments on commit 4aa0502

Please sign in to comment.