Skip to content

Commit

Permalink
Feature: add required reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansingman committed Aug 18, 2023
1 parent 9105e42 commit 1f22e6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ inputs:
description: labels for PR, as comma-separated list
required: false
default: ""
required_reviewers:
description: reviewers required for all PRs
required: false
default: ""

runs:
using: composite
Expand Down Expand Up @@ -57,6 +61,7 @@ runs:
--repository ${{ github.repository }} \
--head-branch=${{ env.DEPLOYMENT_BRANCH }} \
--base-branch=${{ inputs.target }} \
--required-reviewers=${{ inputs.required_reviewers }} \
)" >> $GITHUB_ENV
shell: bash
Expand Down
10 changes: 8 additions & 2 deletions deploy_bot/get_reviewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ def find_contributors_to_branch(repository: str, head_branch: str, base_branch:
dest="base_branch",
help="base branch for comparison",
)
parser.add_argument(
"--required-reviewers",
dest="required_reviewers",
help="list of required reviewers, as comma separated list"
)

args = parser.parse_args()

# find contributors to branch
contributors: Set[str] = find_contributors_to_branch(args.repository, args.head_branch, args.base_branch)

# output contributors as comma delimited list
print(",".join(contributors))
# output reviewers as comma delimited list
reviewers = contributors + required_reviewers.split(",")
print(",".join(reviewers))

exit(0)

0 comments on commit 1f22e6f

Please sign in to comment.