Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ You will receive a pull request within your repository if there are some changes
| 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_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
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
default: 'upstream merge template repository'
pr_labels:
description: '[optional] comma separated list of pull request labels'
pr_commit_msg:
description: '[optional] the commit message of the template merge'
default: 'chore(template): merge template changes :up:'
hostname:
description: '[optional] the hostname of the GitHub repository'
default: 'github.com'
Expand All @@ -41,5 +44,6 @@ runs:
PR_BRANCH_NAME_PREFIX: ${{ inputs.pr_branch_name_prefix }}
PR_TITLE: ${{ inputs.pr_title }}
PR_LABELS: ${{ inputs.pr_labels }}
PR_COMMIT_MSG: ${{ inputs.pr_commit_msg }}
HOSTNAME: ${{ inputs.hostname }}
IS_DRY_RUN: ${{ inputs.is_dry_run }}
7 changes: 6 additions & 1 deletion src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ set -e
# set -u
set -x

if [[ -z "${PR_COMMIT_MSG}" ]]; then
echo "::error::Missing env variable 'PR_COMMIT_MSG'" >&2;
exit 1;
fi

if [[ -z "${SOURCE_REPO}" ]]; then
echo "::error::Missing env variable 'SOURCE_REPO'" >&2;
exit 1;
Expand Down Expand Up @@ -74,7 +79,7 @@ then
git checkout -- .
fi

git commit -m "chore(template): merge template changes :up:"
git commit -m "${PR_COMMIT_MSG}"

push_and_create_pr () {
if [ "$IS_DRY_RUN" != "true" ]; then
Expand Down