Attached you may also find a code sample of a previous iteration.
var labels = []Label{
NewLabel("f44336", "bug", "Something isn't working"),
NewLabel("e91e63", "dependencies", "Pull requests that updates a dependency file"),
NewLabel("9e9e9e", "duplicate", "This issue or pull request already exists"),
NewLabel("3f51b5", "feature", "New feature or request"),
NewLabel("673ab7", "good first issue", "Good for newcomers"),
NewLabel("009688", "help wanted", "Extra attention is needed"),
NewLabel("ffeb3b", "invalid", "This doesn't seem right"),
NewLabel("9c27b0", "question", "Further information is requested"),
NewLabel("ffffff", "wontfix", "This will not be worked on"),
NewLabel("304ffe", "python", "Pull requests that update Python code"),
NewLabel("00bcd4", "go", "Pull requests that update Go code"),
}
type Label struct {
Color string
Name string
Description string
}
func NewLabel(color string, name string, description string) Label {
return Label{Color: color, Name: name, Description: description}
}
func ConfigureLabels(ctx *pulumi.Context, provider *github.Provider, repo Repository, id pulumi.StringOutput) error {
for _, label := range labels {
_, err := github.NewIssueLabel(ctx, fmt.Sprintf("%s-%s", repo.Name, label.Name), &github.IssueLabelArgs{
Repository: id,
Color: pulumi.String(label.Color),
Name: pulumi.String(label.Name),
Description: pulumi.String(label.Description),
}, pulumi.Provider(provider))
if err != nil {
return err
}
}
return nil
}
func ConfigureBranches(ctx *pulumi.Context, provider *github.Provider, repo Repository) error {
branch := "main"
_, err := github.NewBranch(ctx, fmt.Sprintf("%s-%s", repo.Name, branch), &github.BranchArgs{
Repository: pulumi.String(repo.Name),
Branch: pulumi.String(branch),
}, pulumi.Provider(provider))
if err != nil {
return err
}
return nil
}