Skip to content

Commit

Permalink
check if GitHub CLI is installed and react accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
akash1810 committed Feb 5, 2021
1 parent 0b78437 commit 9440506
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions script/release
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ if npm whoami &>/dev/null; then
npm run release

# The default branch is protected.
# Raise a chore PR to bump `version` in `package.json`.
# Push commit to new branch.
NEW_VERSION=$(git log -1 --pretty=%B)
git checkout -b "release-${NEW_VERSION}"
git push -u origin "release-${NEW_VERSION}"
gh pr create --title "chore: ${NEW_VERSION}" --body ""

if ! command -v gh &> /dev/null
then
echo "GitHub CLI not found. Please raise PR manually."
else
# Raise a chore PR to bump `version` in `package.json`.
gh pr create --title "chore: ${NEW_VERSION}" --body ""
fi
else
echo "You are not logged into npm!"
echo " Run 'npm login' first!"
Expand Down

0 comments on commit 9440506

Please sign in to comment.