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