github.com/getgauge/gauge@v1.6.9/build/brew/create_brew_pr.sh (about)

     1  # ----------------------------------------------------------------
     2  #   Copyright (c) ThoughtWorks, Inc.
     3  #   Licensed under the Apache License, Version 2.0
     4  #   See LICENSE.txt in the project root for license information.
     5  # ----------------------------------------------------------------*/
     6  
     7  #!/bin/bash
     8  
     9  set -e
    10  
    11  export BRANCH="gauge-$GAUGE_VERSION"
    12  
    13  git config --global user.name "$HOMEBREW_GITHUB_USER_NAME"
    14  git config --global user.email "$HOMEBREW_GITHUB_USER_EMAIL"
    15  
    16  gh repo sync $HOMEBREW_GITHUB_USER_NAME/homebrew-core \
    17    --source Homebrew/homebrew-core \
    18    --branch master
    19  
    20  (gh repo clone $HOMEBREW_GITHUB_USER_NAME/homebrew-core) || (gh repo clone Homebrew/homebrew-core && cd homebrew-core && gh repo fork Homebrew/homebrew-core)
    21  
    22  cd homebrew-core
    23  git checkout master
    24  
    25  git branch -D $BRANCH || true
    26  git checkout -b $BRANCH
    27  
    28  gem install parser
    29  ruby ../brew_update.rb $GAUGE_VERSION ./Formula/g/gauge.rb
    30  
    31  git add ./Formula/g/gauge.rb
    32  git commit -m "gauge $GAUGE_VERSION"
    33  git push -f "https://$HOMEBREW_GITHUB_USER_NAME:$GITHUB_TOKEN@github.com/$HOMEBREW_GITHUB_USER_NAME/homebrew-core.git" "gauge-$GAUGE_VERSION"
    34  
    35  echo -e "gauge $GAUGE_VERSION \n\n Please cc getgauge/core for any issue." > desc.txt
    36  gh pr create --repo Homebrew/homebrew-core \
    37    --title "gauge $GAUGE_VERSION" \
    38    --body-file ./desc.txt \
    39    --head $HOMEBREW_GITHUB_USER_NAME:$BRANCH