Skip to content

Commit f1ecf63

Browse files
authored
fix: the branch parameter of pr-merge must be supplied. (#66)
For now, setteng $CIRCLE_BRANCH as the default.
1 parent d22ef19 commit f1ecf63

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/jobs/pr-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resource_class: small
1010
parameters:
1111
branch:
1212
type: string
13-
default: ""
13+
default: "$CIRCLE_BRANCH"
1414
description: "Enter PR number, branch or URL to merge. Without an argument, the pull request that belongs to the current branch is selected"
1515
additional_args:
1616
type: string

src/scripts/pr-merge.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ token="${!ORB_ENV_TOKEN}"
99
printf >&2 '%s\n' "A GitHub token must be supplied" "Check the \"token\" parameter."
1010
exit 1
1111
}
12+
[ -z "$branch" ] && {
13+
printf >&2 '%s\n' "A target branch must be supplied" "Check the \"branch\" parameter."
14+
exit 1
15+
}
1216
printf '%s\n' "export GITHUB_TOKEN=$token" >>"$BASH_ENV"
1317
[ -n "$hostname" ] && printf '%s\n' "export GITHUB_HOSTNAME=$hostname" >>"$BASH_ENV"
1418
[ -n "$repo" ] && repo="-R $repo"

0 commit comments

Comments
 (0)