File tree 1 file changed +1
-10
lines changed
1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,7 @@ def github_user_login token
14
14
user [ "login" ] || "error"
15
15
end
16
16
17
- def github_user_auth token
18
- # This call must use .netrc user/pass combination
19
- json = `curl -s https://api.github.com/authorizations` rescue "[]"
20
- all = JSON . parse json rescue [ ]
21
- authz = all . select { |a | a [ "token" ] =~ /#{ token } / } . first || [ ]
22
- "#{ authz [ "note" ] } (#{ authz [ "scopes" ] . include? ( 'repo' ) ? 'private repo access' : 'insufficient access' } )"
23
- end
24
-
25
- def github_user_orgs
17
+ def github_user_orgs token
26
18
json = `curl -H "Authorization: Bearer #{ token } " -s https://api.github.com/user/orgs` rescue "[]"
27
19
orgs = JSON . parse json rescue [ ]
28
20
orgs . map { |o | o [ "login" ] . downcase } . sort
@@ -31,7 +23,6 @@ def github_user_orgs
31
23
def user_block token
32
24
<<-USER
33
25
Github User: #{ login ( token ) }
34
- Authorization: #{ github_user_auth ( token ) }
35
26
Organizations: #{ github_user_orgs ( token ) . join ( ", " ) }
36
27
USER
37
28
end
You can’t perform that action at this time.
0 commit comments