Skip to content

Commit 0200039

Browse files
committed
remove hardcoded scopes
1 parent 9c55b7c commit 0200039

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

api/ruby/find-inactive-members/find_inactive_members.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require 'optparse'
44
require 'optparse/date'
55

6+
SCOPES=["read:org", "read:user", "repo", "user:email"]
7+
68
def env_help
79
output=<<-EOM
810
Required Environment variables:
@@ -67,7 +69,7 @@ def info(message)
6769
end
6870

6971
def check_scopes
70-
info "Scopes #{@client.scopes.join ','}\n"
72+
info "Scopes: #{@client.scopes.join ','}\n"
7173
end
7274

7375
def check_app
@@ -81,7 +83,7 @@ def get_auth_token(login, password, otp)
8183
res = temp_client.create_authorization(
8284
{
8385
:idempotent => true,
84-
:scopes => ["read:org", "read:user", "repo", "user:email"],
86+
:scopes => SCOPES,
8587
:headers => {'X-GitHub-OTP' => otp}
8688
})
8789
res[:token]

0 commit comments

Comments
 (0)