Skip to content

Commit

Permalink
feat: ability to add reviewers for pull requests
Browse files Browse the repository at this point in the history
Signed-off-by: David Calvert <[email protected]>
  • Loading branch information
David Calvert committed Jul 17, 2023
1 parent 18b8739 commit fa79478
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ jobs:
| pr_branch_name_prefix | `[optional]` the prefix of branches created by this action | `false` | `chore/template_sync` |
| pr_title | `[optional]` the title of PRs opened by this action. Must be already created. | `false` | `upstream merge template repository` |
| pr_labels | `[optional]` comma separated list. [pull request labels][pr-labels]. Must be already created. | `false` | |
| pr_reviewers | `[optional]` comma separated list of pull request reviewers. | `false` | |
| pr_commit_msg | `[optional]` commit message in the created pull request | `false` | `chore(template): merge template changes :up:` |
| hostname | `[optional]` the hostname of the repository | `false` | `github.com` |
| is_dry_run | `[optional]` set to `true` if you do not want to push the changes and not want to create a PR | `false` | |
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ inputs:
default: "upstream merge template repository"
pr_labels:
description: "[optional] comma separated list of pull request labels"
pr_reviewers:
description: "[optional] comma separated list of pull request reviewers"
pr_commit_msg:
description: "[optional] the commit message of the template merge"
default: "chore(template): merge template changes :up:"
Expand Down Expand Up @@ -54,6 +56,7 @@ runs:
PR_BRANCH_NAME_PREFIX: ${{ inputs.pr_branch_name_prefix }}
PR_TITLE: ${{ inputs.pr_title }}
PR_LABELS: ${{ inputs.pr_labels }}
PR_REVIEWERS: ${{ inputs.pr_reviewers }}
PR_COMMIT_MSG: ${{ inputs.pr_commit_msg }}
HOSTNAME: ${{ inputs.hostname }}
IS_DRY_RUN: ${{ inputs.is_dry_run }}
Expand Down
5 changes: 3 additions & 2 deletions src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ push_and_create_pr () {
gh pr create \
--title "${PR_TITLE}" \
--body "Merge ${SOURCE_REPO_PATH} ${NEW_TEMPLATE_GIT_HASH}" \
-B "${UPSTREAM_BRANCH}" \
-l "${PR_LABELS}"
--base "${UPSTREAM_BRANCH}" \
--label "${PR_LABELS}" \
--reviewer "${{ PR_REVIEWERS }}"
echo "::endgroup::"
else
warn "dry_run option is set to off. Skipping push changes and skip create pr"
Expand Down

0 comments on commit fa79478

Please sign in to comment.