diff --git a/README.md b/README.md index 46f63d67..ca2281cf 100644 --- a/README.md +++ b/README.md @@ -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` | | diff --git a/action.yml b/action.yml index 9d7bc96f..a4a23b5d 100644 --- a/action.yml +++ b/action.yml @@ -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:" @@ -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 }} diff --git a/src/sync_template.sh b/src/sync_template.sh index 3b159e47..e7a4fb3a 100644 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -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"