Skip to content

Commit

Permalink
Merge pull request #7 from BESTSELLER/default_labels
Browse files Browse the repository at this point in the history
added default labels
  • Loading branch information
brondum authored Oct 16, 2020
2 parents 1c6f932 + b0ad041 commit 40f3f96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gh/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,18 @@ func CreatePR(ctx context.Context, client *github.Client, repoOwner string, repo
return nil, err
}

// we dont care about your errors!
// disect team reviewers
var teamReviewers []string
for _, reviewer := range reviewers {
if strings.Contains(reviewer, "/") {
teamReviewers = append(teamReviewers, strings.Split(reviewer, "/")[1])
}
}

// add default labels
labels = append(labels, []string{"dependencies", "circleci"}...)

// we dont care about your errors!
client.PullRequests.RequestReviewers(ctx, repoOwner, repoName, pr.GetNumber(), github.ReviewersRequest{Reviewers: reviewers, TeamReviewers: teamReviewers})
client.Issues.AddAssignees(ctx, repoOwner, repoName, pr.GetNumber(), assignees)
client.Issues.AddLabelsToIssue(ctx, repoOwner, repoName, pr.GetNumber(), labels)
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-github v15.0.0+incompatible h1:jlPg2Cpsxb/FyEV/MFiIE9tW/2RAevQNZDPeHbf5a94=
github.com/google/go-github v15.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
github.com/google/go-github/v29 v29.0.2/go.mod h1:CHKiKKPHJ0REzfwc14QMklvtHwCveD0PxlMjLlzAM5E=
github.com/google/go-github/v29 v29.0.3 h1:IktKCTwU//aFHnpA+2SLIi7Oo9uhAzgsdZNbcAqhgdc=
github.com/google/go-github/v29 v29.0.3/go.mod h1:CHKiKKPHJ0REzfwc14QMklvtHwCveD0PxlMjLlzAM5E=
Expand Down

0 comments on commit 40f3f96

Please sign in to comment.