diff --git a/pkg/github/github.go b/pkg/github/github.go index ffe4ef2..2f18761 100644 --- a/pkg/github/github.go +++ b/pkg/github/github.go @@ -17,6 +17,7 @@ package github import ( "context" "io/ioutil" + "strings" "github.com/google/go-github/github" "golang.org/x/oauth2" @@ -42,6 +43,9 @@ func FromManifestToLabels(path string) ([]Label, error) { } var labels []Label err = yaml.Unmarshal(buf, &labels) + for _, l := range labels { + l.NormalizeColor() + } return labels, err } @@ -156,3 +160,7 @@ func (c *Client) deleteLabel(ctx context.Context, owner, repo, name string) erro _, err := c.githubClient.Issues.DeleteLabel(ctx, owner, repo, name) return err } + +func (l *Label) NormalizeColor() { + l.Color = strings.TrimPrefix(l.Color, "#") +}