forked from Drift/pvv-nixos-config
bekkalokk/gitea: fix api pagination for web secret provider
This commit is contained in:
parent
40dd069a52
commit
02792fc20e
@ -34,7 +34,21 @@ def get_org_repo_list(args: argparse.Namespace, token: str):
|
||||
f"{args.api_url}/orgs/{args.org}/repos",
|
||||
headers = { 'Authorization': 'token ' + token },
|
||||
)
|
||||
return [repo["name"] for repo in result.json()]
|
||||
|
||||
results = [repo["name"] for repo in result.json()]
|
||||
target = int(result.headers['X-Total-Count'])
|
||||
|
||||
i = 2
|
||||
while len(results) < target:
|
||||
result = requests.get(
|
||||
f"{args.api_url}/orgs/{args.org}/repos",
|
||||
params = { 'page': i },
|
||||
headers = { 'Authorization': 'token ' + token },
|
||||
)
|
||||
results += [repo["name"] for repo in result.json()]
|
||||
i += 1
|
||||
|
||||
return results
|
||||
|
||||
|
||||
def generate_ssh_key(args: argparse.Namespace, repository: str):
|
||||
|
Loading…
Reference in New Issue
Block a user