Skip to content

Commit

Permalink
feat(action): add parameter for gh action configuration (#129) 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasAugustin committed Dec 16, 2021
1 parent 81123c2 commit 55484dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
default: 'main'
source_repo_ssh_private_key:
description: '[optional] private ssh key for the source repository. E.q. useful if using a private template repository.'
pr_labels:
description: '[optional] comma separated list of pull request labels'
default: 'chore,template-sync'
runs:
using: 'docker'
image: 'src/Dockerfile'
Expand All @@ -25,3 +28,4 @@ runs:
SOURCE_REPO_PATH: ${{ inputs.source_repo_path }}
UPSTREAM_BRANCH: ${{ inputs.upstream_branch }}
SSH_PRIVATE_KEY_SRC: ${{ inputs.source_repo_ssh_private_key}}
PR_LABELS: ${{inputs.pr_labels}}
8 changes: 7 additions & 1 deletion src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ if [[ -z "${UPSTREAM_BRANCH}" ]]; then
exit 1;
fi

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

if ! [ -x "$(command -v gh)" ]; then
echo "::error::github-cli gh is not installed. 'https://github.com/cli/cli'" >&2;
exit 1;
Expand Down Expand Up @@ -82,5 +87,6 @@ echo "::group::create pull request"
gh pr create \
--title "upstream merge template repository" \
--body "Merge ${SOURCE_REPO_PATH} ${NEW_TEMPLATE_GIT_HASH}" \
-B "${UPSTREAM_BRANCH}"
-B "${UPSTREAM_BRANCH}" \
-l "${PR_LABELS}"
echo "::endgroup::"

0 comments on commit 55484dc

Please sign in to comment.