@@ -92,11 +92,11 @@ def gitlabSetup(GITLABTOKEN=""):
92
92
SESSION .headers .update ({"PRIVATE-TOKEN" : GITLABTOKEN })
93
93
94
94
95
- def req2Json (url , parameterDict = None , requestType = "GET" ):
95
+ def req2Json (url , parameterDict = None , requestType = "GET" , queryParameters = None ):
96
96
"""Call to github API using requests package."""
97
97
log = LOGGER .getChild ("Requests" )
98
98
log .debug ("Running %s with %s " , requestType , parameterDict )
99
- req = getattr (SESSION , requestType .lower ())(url , json = parameterDict )
99
+ req = getattr (SESSION , requestType .lower ())(url , json = parameterDict , params = queryParameters )
100
100
if req .status_code not in (200 , 201 ):
101
101
log .error ("Unable to access API: %s" , req .text )
102
102
raise RuntimeError ("Failed to access API" )
@@ -433,7 +433,7 @@ def parseOptions(self):
433
433
for var , val in sorted (vars (parsed ).items ()):
434
434
log .info ("Using options: %s = %s" , var , pformat (val ))
435
435
436
- def _github (self , action ):
436
+ def _github (self , action , per_page = None ):
437
437
"""Return the url to perform actions on github.
438
438
439
439
:param str action: command to use in the gitlab API, see documentation there
@@ -442,6 +442,7 @@ def _github(self, action):
442
442
log = LOGGER .getChild ("GitHub" )
443
443
options = dict (self ._options )
444
444
options ["action" ] = action
445
+
445
446
ghURL = f"https://api.github.com/repos/{ options ['owner' ]} /{ options ['repo' ]} /{ options ['action' ]} "
446
447
log .debug ("Calling: %s" , ghURL )
447
448
return ghURL
@@ -504,7 +505,7 @@ def getGithubLatestTagDate(self, sinceTag):
504
505
log = LOGGER .getChild ("getGithubLatestTagDate" )
505
506
506
507
# Get all tags
507
- tags = req2Json (url = self ._github ("tags" ))
508
+ tags = req2Json (url = self ._github ("tags" ), queryParameters = { "per_page" : 100 } )
508
509
if isinstance (tags , dict ) and "Not Found" in tags .get ("message" ):
509
510
raise RuntimeError (f"Package not found: { str (self )} " )
510
511
0 commit comments