File tree 2 files changed +12
-5
lines changed
2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -32,14 +32,15 @@ var reassignReviewerCmd = &cobra.Command{
32
32
33
33
The command expects the following PR details as arguments:
34
34
1. PR_NUMBER
35
- 2. REVIEWER (optional)
35
+ 2. COMMENT_AUTHOR
36
+ 3. REVIEWER (optional)
36
37
37
38
38
39
It then performs the following operations:
39
40
1. Updates the reviewer comment to reflect the new primary reviewer.
40
41
2. Requests a review from the new primary reviewer.
41
42
` ,
42
- Args : cobra .MinimumNArgs (1 ),
43
+ Args : cobra .MinimumNArgs (2 ),
43
44
RunE : func (cmd * cobra.Command , args []string ) error {
44
45
prNumber := args [0 ]
45
46
fmt .Println ("PR Number: " , prNumber )
@@ -49,9 +50,15 @@ var reassignReviewerCmd = &cobra.Command{
49
50
return fmt .Errorf ("did not provide GITHUB_TOKEN environment variable" )
50
51
}
51
52
gh := github .NewClient (githubToken )
53
+
54
+ author := args [1 ]
55
+ if gh .GetUserType (author ) != github .CoreContributorUserType {
56
+ return fmt .Errorf ("comment author is not a core contributor" )
57
+ }
58
+
52
59
var newPrimaryReviewer string
53
- if len (args ) > 1 {
54
- newPrimaryReviewer = args [1 ]
60
+ if len (args ) > 2 {
61
+ newPrimaryReviewer = args [2 ]
55
62
}
56
63
return execReassignReviewer (prNumber , newPrimaryReviewer , gh )
57
64
},
Original file line number Diff line number Diff line change 42
42
go build .
43
43
- name : Run command
44
44
if : steps.read-comment.outputs.match != ''
45
- run : .ci/magician/magician reassign-reviewer ${{ github.event.issue.number }} ${{ steps.read-comment.outputs.group1 }}
45
+ run : .ci/magician/magician reassign-reviewer ${{ github.event.issue.number }} ${{ github.event.comment.user.login }} ${{ steps.read-comment.outputs.group1 }}
You can’t perform that action at this time.
0 commit comments