Skip to content

Commit

Permalink
Adding HOOK/KEY to the output of hooks and keys to ease group archives.
Browse files Browse the repository at this point in the history
  • Loading branch information
cknowles-moz committed Jul 23, 2024
1 parent b19fdd0 commit 82b166e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions repo_archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def report_on_hooks(repo):
"""
result = []
for hook in repo.hooks():
result.append(f"{repo.owner.login},{repo.name},{hook.config['url']},{hook.active}")
result.append(f"HOOK,{repo.owner.login},{repo.name},{hook.config['url']},{hook.active}")
return result


Expand All @@ -242,7 +242,7 @@ def report_on_keys(repo):
result = []
for key in repo.keys():
result.append(
f"{repo.owner.login},{repo.name},{key.title},{key.created_at},{key.last_used}"
f"KEY,{repo.owner.login},{repo.name},{key.title},{key.created_at},{key.last_used}"
)
return result

Expand All @@ -253,8 +253,8 @@ def main():
"""
args = parse_args()
gh_sess = login(token=args.token)
key_report_list = ["org,repo,key"]
hook_report_list = ["org,repo,hookURL,status"]
key_report_list = ["type,org,repo,key"]
hook_report_list = ["type,org,repo,hookURL,status"]

repolist = []
if args.repos != []:
Expand Down

0 comments on commit 82b166e

Please sign in to comment.