diff --git a/README.md b/README.md index 66c162d..bc4f6d2 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,7 @@ jobs: | source_repo_ssh_private_key | `[optional]` private ssh key for the source repository. [see](#private-template-repository) | `false` | | | 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_body | `[optional]` the body of PRs opened by this action. | `false` | `Merge ${SOURCE_REPO_PATH} ${TEMPLATE_GIT_HASH}` | | pr_labels | `[optional]` comma separated list. [pull request labels][pr-labels]. | `false` | `sync_template` | | 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:` | diff --git a/action.yml b/action.yml index 8fc113e..41e2f6d 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,8 @@ inputs: pr_title: description: "[optional] the title of PRs opened by this action" default: "upstream merge template repository" + pr_body: + description: "[optional] the body of PRs opened by this action" pr_labels: description: "[optional] comma separated list of pull request labels" default: "template_sync" @@ -65,6 +67,7 @@ runs: SSH_PRIVATE_KEY_SRC: ${{ inputs.source_repo_ssh_private_key }} PR_BRANCH_NAME_PREFIX: ${{ inputs.pr_branch_name_prefix }} PR_TITLE: ${{ inputs.pr_title }} + PR_BODY: ${{ inputs.pr_body }} PR_LABELS: ${{ inputs.pr_labels }} PR_REVIEWERS: ${{ inputs.pr_reviewers }} PR_COMMIT_MSG: ${{ inputs.pr_commit_msg }} diff --git a/src/sync_template.sh b/src/sync_template.sh index a474dd3..25f4db6 100644 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -44,6 +44,7 @@ TEMPLATE_SYNC_IGNORE_FILE_PATH=".templatesyncignore" TEMPLATE_REMOTE_GIT_HASH=$(git ls-remote "${SOURCE_REPO}" HEAD | awk '{print $1}') NEW_TEMPLATE_GIT_HASH=$(git rev-parse --short "${TEMPLATE_REMOTE_GIT_HASH}") NEW_BRANCH="${PR_BRANCH_NAME_PREFIX}_${NEW_TEMPLATE_GIT_HASH}" +PR_BODY="${PR_BODY:-Merge ${SOURCE_REPO_PATH} ${NEW_TEMPLATE_GIT_HASH}}" debug "new Git HASH ${NEW_TEMPLATE_GIT_HASH}" echo "::group::Check new changes" @@ -234,7 +235,7 @@ function push () { function create_pr () { gh pr create \ --title "${PR_TITLE}" \ - --body "Merge ${SOURCE_REPO_PATH} ${NEW_TEMPLATE_GIT_HASH}" \ + --body "${PR_BODY}" \ --base "${UPSTREAM_BRANCH}" \ --label "${PR_LABELS}" \ --reviewer "${PR_REVIEWERS}"