Skip to content

Commit

Permalink
Improve gitlab provider label generation
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Bersani <[email protected]>
  • Loading branch information
B3rs committed Jan 26, 2024
1 parent f87af76 commit 1d6d5f4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/providers/gitlab/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,16 @@ func (c *Client) makeProjects(projects []*gitlab.Project) []project.Project {
for i, proj := range projects {
labels := make(map[string]string)
for _, topic := range proj.Topics {
if split := strings.Split(topic, ": "); len(split) > 1 {
labels[split[0]] = split[1]
split := strings.Split(topic, ":")

key := strings.Trim(split[0], " ")
if len(split) == 1 {
labels[key] = "true"
continue
}

value := strings.Trim(split[1], " ")
labels[key] = value
}

result[i] = project.Project{
Expand Down

0 comments on commit 1d6d5f4

Please sign in to comment.