Skip to content

Commit

Permalink
Fix attributions2json to work without GITHUB_ACCESS_TOKEN being set
Browse files Browse the repository at this point in the history
  • Loading branch information
sirnacnud committed Jul 2, 2019
1 parent e4891aa commit 066004c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion attributions2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ def get_owner_name(repo):


def get_content_headers():
headers = {}
if os.environ.has_key('GITHUB_ACCESS_TOKEN'):
return { 'Authorization': 'token %s' % os.environ['GITHUB_ACCESS_TOKEN'] }
headers['Authorization'] = 'token %s' % os.environ['GITHUB_ACCESS_TOKEN']
return headers


def send_content_request(repo, path):
Expand Down

0 comments on commit 066004c

Please sign in to comment.