File tree 1 file changed +5
-33
lines changed
1 file changed +5
-33
lines changed Original file line number Diff line number Diff line change 50
50
console.log("This workflow is running within an invalid context")
51
51
process.exit(1)
52
52
}
53
-
54
- // This list should match with CODEOWNERS.
55
- let requiredReviewers = {
56
- gobbleturk: "",
57
- khatwanimohit: "",
58
- bvandermoon: "",
59
- vipannalla: "",
60
- RissyRan: "",
61
- richjames0: "",
62
- rni418: "",
63
- gagika: "",
64
- shralex: "",
65
- yangyuwei: "",
66
- SurbhiJainUSC: "",
67
- hengtaoguo: "",
68
- A9isha: "",
69
- wang2yn84: "",
70
- wyzhang: "",
71
- mitalisi: "",
72
- gpolovets1: "",
73
- mailvijayasingh: "",
74
- jrplatin: "",
75
- patemotter: "",
76
- lumosis: "",
77
- aireenmei: "",
78
- }
79
53
const reviews = await github.rest.pulls.listReviews({
80
54
owner,
81
55
repo,
@@ -93,14 +67,12 @@ jobs:
93
67
console.log("Not adding pull ready because the PR is not approved yet.")
94
68
process.exit()
95
69
}
96
- let num_approved = 0
97
- for (const review of reviews.data) {
98
- if (review.state === "APPROVED" && review.user.login in requiredReviewers) {
99
- num_approved = num_approved + 1
100
- }
70
+ let is_approved = false
71
+ if (pullRequest.state === "APPROVED") {
72
+ is_approved = true
101
73
}
102
- if (num_approved < 2 ) {
103
- console.log("Not adding pull ready because the PR is not approved yet by 2 code owners.")
74
+ if (!is_approved ) {
75
+ console.log("Not adding pull ready because the PR is not approved yet by sufficient code owners.")
104
76
process.exit()
105
77
}
106
78
You can’t perform that action at this time.
0 commit comments