Skip to content

Commit e99f492

Browse files
committed
Merge pull request qltysh#248 from codeclimate/pb-prep-release
Centralize on hub, use stdin
2 parents 8f362b9 + 3e54e0c commit e99f492

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

bin/prep-release

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,23 @@ printf "RELEASE %s => %s\n" "$old_version" "$version"
2525
git checkout master
2626
git pull
2727

28-
git checkout -b $branch
28+
git checkout -b "$branch"
2929

3030
printf "%s\n" "$version" > VERSION
3131
bundle
3232
git add VERSION Gemfile.lock
3333
git commit -m "Release v$version"
34-
git push origin $branch
34+
git push origin "$branch"
3535

36-
compare_link="https://github.com/codeclimate/codeclimate/compare/${old_version}...$(git rev-parse --short $branch)"
37-
pr_description_file=$(mktemp -t cc_commit_message) || exit 1
38-
printf "Release v$version\n\n$s\n" "$compare_link" > "$pr_description_file"
36+
branch_head=$(git rev-parse --short $branch)
3937
if command -v hub > /dev/null 2>&1; then
40-
hub pull-request -F "$pr_description_file"
41-
elif command -v gh > /dev/null 2>&1; then
42-
gh pull-request -F "$pr_description_file"
38+
hub pull-request -F - <<EOF
39+
Release v$version
40+
41+
https://github.com/codeclimate/codeclimate/compare/$old_version...$branch_head
42+
EOF
4343
else
4444
echo "hub not installed? Please open the PR manually" >&2
4545
fi
46-
rm "$commit_message_file"
4746

4847
echo "After merging the version-bump PR, run bin/release"

0 commit comments

Comments
 (0)