Add Support For Labels

This commit is contained in:
Matt Petersen 2024-07-15 12:09:16 -06:00
parent b55b06bc42
commit aba70161cf
8 changed files with 18 additions and 22 deletions

11
main.go
View file

@ -173,6 +173,8 @@ func main() {
issueTitle := os.Getenv(envVarIssueTitle)
issueBody := os.Getenv(envVarIssueBody)
issueLabels := strings.Split(strings.ReplaceAll(os.Getenv(envVarIssueLabels), " ", ""), ",")
minimumApprovalsRaw := os.Getenv(envVarMinimumApprovals)
minimumApprovals := 0
if minimumApprovalsRaw != "" {
@ -182,14 +184,7 @@ func main() {
os.Exit(1)
}
}
labelsRaw := os.Getenv(envVarLabels)
labels := []string{}
if labelsRaw != "" {
labels = strings.Split(labelsRaw, ",")
}
apprv, err := newApprovalEnvironment(client, repoFullName, repoOwner, runID, approvers, minimumApprovals, issueTitle, issueBody, labels)
apprv, err := newApprovalEnvironment(client, repoFullName, repoOwner, runID, approvers, minimumApprovals, issueTitle, issueBody, issueLabels)
if err != nil {
fmt.Printf("error creating approval environment: %v\n", err)
os.Exit(1)