github: use keyfile
This commit is contained in:
parent
a73314dc64
commit
82dba4a965
|
@ -145,7 +145,7 @@ class Source:
|
|||
async def worker(name, conf):
|
||||
await token_q.get()
|
||||
try:
|
||||
ret = await get_version(name, conf)
|
||||
ret = await get_version(name, conf, keyman=self.keymanager)
|
||||
return name, ret
|
||||
except Exception as e:
|
||||
return name, e
|
||||
|
|
|
@ -38,6 +38,10 @@ async def get_version(name, conf, **kwargs):
|
|||
}
|
||||
if 'NVCHECKER_GITHUB_TOKEN' in os.environ:
|
||||
headers['Authorization'] = 'token %s' % os.environ['NVCHECKER_GITHUB_TOKEN']
|
||||
else:
|
||||
key = kwargs['keyman'].get_key('github')
|
||||
if key:
|
||||
headers['Authorization'] = 'token %s' % key
|
||||
|
||||
kwargs = {}
|
||||
if conf.get('proxy'):
|
||||
|
|
Loading…
Reference in New Issue