File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -53,13 +53,15 @@ exports.handler = async function(event) {
53
53
const command = params . get ( 'command' ) ;
54
54
const userId = params . get ( 'user_id' ) ;
55
55
56
- const allowedUsers = ( process . env . ALLOWED_USERS || '' ) . split ( ',' ) ;
57
- if ( ! allowedUsers . includes ( userId ) ) {
56
+ const allowedUsers = ( process . env . ALLOWED_USERS || '' )
57
+ . split ( ',' )
58
+ . map ( u => u . trim ( ) . toLowerCase ( ) ) ;
59
+ if ( ! allowedUsers . includes ( userId . toLowerCase ( ) ) ) {
58
60
throw new Error ( `User '${ params . get ( 'user_name' ) } ' is not allowed to run command` ) ;
59
61
}
60
62
61
63
const expectedCommand = process . env . PUBLISH_COMMAND ;
62
- if ( expectedCommand && expectedCommand == command ) {
64
+ if ( expectedCommand && expectedCommand === command ) {
63
65
const githubToken = process . env . GITHUB_TOKEN ;
64
66
const repo = process . env . GITHUB_REPO ;
65
67
await axios ( {
You can’t perform that action at this time.
0 commit comments