File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,24 @@ export async function verify(body): Promise<any> {
97
97
98
98
if ( ! isController && ! isEqual ( admins , newAdmins ) )
99
99
return Promise . reject ( 'not allowed change admins' ) ;
100
+
101
+ const labels = msg . payload . labels || [ ] ;
102
+ if ( labels . length ) {
103
+ const uniqueLabelsIds = new Set < string > ( ) ;
104
+ const uniqueLabelsNames = new Set < string > ( ) ;
105
+ for ( const { id, name } of labels ) {
106
+ const labelId = id . toLowerCase ( ) ;
107
+ const labelName = name . toLowerCase ( ) ;
108
+ if ( uniqueLabelsIds . has ( labelId ) ) {
109
+ return Promise . reject ( 'duplicate label id' ) ;
110
+ }
111
+ if ( uniqueLabelsNames . has ( labelName ) ) {
112
+ return Promise . reject ( 'duplicate label name' ) ;
113
+ }
114
+ uniqueLabelsIds . add ( labelId ) ;
115
+ uniqueLabelsNames . add ( labelName ) ;
116
+ }
117
+ }
100
118
}
101
119
102
120
export async function action ( body ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments