Skip to content

Commit

Permalink
Replacing deprecated hub with gh cli (#2352)
Browse files Browse the repository at this point in the history
  • Loading branch information
haroon-sheikh authored Jun 22, 2023
1 parent 688ba31 commit 2946c75
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions build/brew/create_brew_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export BRANCH="gauge-$GAUGE_VERSION"
git config --global user.name "$HOMEBREW_GITHUB_USER_NAME"
git config --global user.email "$HOMEBREW_GITHUB_USER_EMAIL"

gh repo sync $HOMEBREW_GITHUB_USER_NAME/homebrew-core \
--source Homebrew/homebrew-core \
--branch master

(hub clone homebrew-core) || (hub clone Homebrew/homebrew-core && cd homebrew-core && hub fork)
(gh repo clone $HOMEBREW_GITHUB_USER_NAME/homebrew-core) || (gh repo clone Homebrew/homebrew-core && cd homebrew-core && gh repo fork Homebrew/homebrew-core)

cd homebrew-core
git remote add upstream https://github.com/Homebrew/homebrew-core.git
git fetch upstream
git checkout master
git merge upstream/master

git branch -D $BRANCH || true
git checkout -b $BRANCH
Expand All @@ -30,6 +30,10 @@ ruby ../brew_update.rb $GAUGE_VERSION ./Formula/gauge.rb

git add ./Formula/gauge.rb
git commit -m "gauge $GAUGE_VERSION"
git push "https://$HOMEBREW_GITHUB_USER_NAME:$GITHUB_TOKEN@github.com/$HOMEBREW_GITHUB_USER_NAME/homebrew-core.git" "gauge-$GAUGE_VERSION"
git push -f "https://$HOMEBREW_GITHUB_USER_NAME:$GITHUB_TOKEN@github.com/$HOMEBREW_GITHUB_USER_NAME/homebrew-core.git" "gauge-$GAUGE_VERSION"

echo -e "gauge $GAUGE_VERSION \n\n Please cc getgauge/core for any issue." > desc.txt
hub pull-request --base Homebrew:master --head $HOMEBREW_GITHUB_USER_NAME:$BRANCH -F ./desc.txt
gh pr create --repo Homebrew/homebrew-core \
--title "gauge $GAUGE_VERSION" \
--body-file ./desc.txt \
--head $HOMEBREW_GITHUB_USER_NAME:$BRANCH

0 comments on commit 2946c75

Please sign in to comment.