File tree Expand file tree Collapse file tree 4 files changed +229
-737
lines changed
Expand file tree Collapse file tree 4 files changed +229
-737
lines changed Original file line number Diff line number Diff line change @@ -87,18 +87,21 @@ module.exports = (app) => {
8787 app . log . info ( fileContent ) ;
8888
8989 // create an issue using fileContent as body if pr_author is included in copilotSeats using Copilot Seat Billing api
90- let copilotSeats = await context . octokit . request (
91- "GET /orgs/{org}/copilot/billing/seats" ,
92- {
93- org : organization_name ,
94- headers : {
95- 'X-GitHub-Api-Version' : '2022-11-28'
90+ let copilotSeatUsers = [ ] ;
91+ if ( VALIDATE_SEAT_ASSIGNMENT == "YES" ) {
92+ let copilotSeats = await context . octokit . request (
93+ "GET /orgs/{org}/copilot/billing/seats" ,
94+ {
95+ org : organization_name ,
96+ headers : {
97+ 'X-GitHub-Api-Version' : '2022-11-28'
98+ }
9699 }
97- }
98- ) ;
99- let copilotSeatUsers = copilotSeats . data . seats ;
100+ ) ;
101+ copilotSeatUsers = copilotSeats . data . seats ;
102+ }
100103
101- if ( ( Boolean ( VALIDATE_SEAT_ASSIGNMENT ) && copilotSeatUsers . some ( user => user . assignee . login == pr_author ) ) || ! Boolean ( VALIDATE_SEAT_ASSIGNMENT ) ) {
104+ if ( VALIDATE_SEAT_ASSIGNMENT != "YES" || ( VALIDATE_SEAT_ASSIGNMENT == "YES" && copilotSeatUsers . some ( user => user . assignee . login == pr_author ) ) ) {
102105 try {
103106 await context . octokit . issues . create ( {
104107 owner : organization_name ,
You can’t perform that action at this time.
0 commit comments