Skip to content

Commit

Permalink
fix: report result check
Browse files Browse the repository at this point in the history
  • Loading branch information
yanksyoon committed Mar 4, 2024
1 parent 4e7a7cc commit de426f5
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions repo_policy_compliance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,20 @@ def pull_request(

# The github_client argument is injected, disabling missing arguments check for this function
# pylint: disable=no-value-for-parameter
if (
policy.enabled(
job_type=policy.JobType.PULL_REQUEST,
name=policy.PullRequestProperty.TARGET_BRANCH_PROTECTION,
policy_document=used_policy_document,
)
and (
if policy.enabled(
job_type=policy.JobType.PULL_REQUEST,
name=policy.PullRequestProperty.TARGET_BRANCH_PROTECTION,
policy_document=used_policy_document,
) and (
(
target_branch_report := check.target_branch_protection(
repository_name=input_.repository_name,
branch_name=input_.target_branch_name,
source_repository_name=input_.source_repository_name,
)
).result
== check.Result.FAIL
or target_branch_report.result == check.Result.ERROR
):
return target_branch_report

Expand Down Expand Up @@ -159,8 +159,11 @@ def workflow_dispatch(
policy_document=used_policy_document,
)
and (
collaborators_report := check.collaborators(repository_name=input_.repository_name)
).result
(
collaborators_report := check.collaborators(repository_name=input_.repository_name)
).result
or collaborators_report.result == check.Result.ERROR
)
== check.Result.FAIL
):
return collaborators_report
Expand Down

0 comments on commit de426f5

Please sign in to comment.