Skip to content

Commit

Permalink
fix: the branch parameter of pr-merge must be supplied. (#66)
Browse files Browse the repository at this point in the history
For now, setteng $CIRCLE_BRANCH as the default.
  • Loading branch information
takuo authored Dec 17, 2024
1 parent d22ef19 commit f1ecf63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/jobs/pr-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource_class: small
parameters:
branch:
type: string
default: ""
default: "$CIRCLE_BRANCH"
description: "Enter PR number, branch or URL to merge. Without an argument, the pull request that belongs to the current branch is selected"
additional_args:
type: string
Expand Down
4 changes: 4 additions & 0 deletions src/scripts/pr-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ token="${!ORB_ENV_TOKEN}"
printf >&2 '%s\n' "A GitHub token must be supplied" "Check the \"token\" parameter."
exit 1
}
[ -z "$branch" ] && {
printf >&2 '%s\n' "A target branch must be supplied" "Check the \"branch\" parameter."
exit 1
}
printf '%s\n' "export GITHUB_TOKEN=$token" >>"$BASH_ENV"
[ -n "$hostname" ] && printf '%s\n' "export GITHUB_HOSTNAME=$hostname" >>"$BASH_ENV"
[ -n "$repo" ] && repo="-R $repo"
Expand Down

0 comments on commit f1ecf63

Please sign in to comment.