Skip to content

Commit

Permalink
feat: fix for gitlab
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollorion committed Aug 2, 2024
1 parent 2a4b427 commit bcc1826
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spacemk/exporters/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,11 @@ def find_workspace_variable_with_invalid_name(data: dict, workspace_id: str, typ
else:
raise ValueError(f"Unknown VCS provider name ({provider})")

if workspace.get("attributes.vcs-repo.identifier"):
if provider == "gitlab" and workspace.get("attributes.vcs-repo.identifier"):
segments = workspace.get("attributes.vcs-repo.identifier").split("/")
vcs_namespace = "/".join(segments[:-1])
vcs_repository = segments[-1]
elif workspace.get("attributes.vcs-repo.identifier"):
segments = workspace.get("attributes.vcs-repo.identifier").split("/")
vcs_namespace = segments[0]
vcs_repository = segments[1]
Expand Down

0 comments on commit bcc1826

Please sign in to comment.