Skip to content

Commit

Permalink
log cirun response
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Aug 27, 2023
1 parent 37d0252 commit 94aac9e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions conda_smithy/cirun_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,20 @@ def add_repo_to_cirun_resource(owner, repo, resource, cirun_policy_args):
if "pull_request" in cirun_policy_args:
policy_args["pull_request"] = True
print(f"Adding repo {owner}/{repo} to resource {resource} with policy_args: {policy_args}")
cirun.add_repo_to_resources(owner, repo, resources=[resource], teams=[repo], policy_args=policy_args)
response = cirun.add_repo_to_resources(
owner, repo, resources=[resource], teams=[repo], policy_args=policy_args
)
print(f"response: {response} | {response.json().keys()}")
return response


def remove_repo_from_cirun_resource(owner, repo, resource):
"""Revoke access to a cirun resource to a particular repository, with a particular policy."""
cirun = _get_cirun_client()
print(f"Removing repo {owner}/{repo} from resource {resource}.")
cirun.remove_repo_from_resources(owner, repo, [resource])
response = cirun.remove_repo_from_resources(owner, repo, [resource])
print(f"response: {response} | {response.json().keys()}")
return response


def _get_cirun_client():
Expand Down

0 comments on commit 94aac9e

Please sign in to comment.