Skip to content

Commit

Permalink
Make the Danger homebrew script directly push to the homebrew repo
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed Oct 10, 2018
1 parent 22a4f47 commit b478682
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions scripts/create-homebrew-tap-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ if [ ! -f ${FILE} ]; then
exit 1
fi

BRANCH="releasing-${VERSION}"
SHA=$(shasum -a 256 ${FILE} | cut -f 1 -d " ")
echo "$SHA"

# Clone tap repo
HOMEBREW_TAP_TMPDIR=$(mktemp -d)
git clone --depth 1 git@github.com:danger/homebrew-tap.git "$HOMEBREW_TAP_TMPDIR"
cd "$HOMEBREW_TAP_TMPDIR" || exit 1
git config user.name danger
git config user.email danger@users.noreply.github.com
git checkout -b "${BRANCH}"

# git config user.name danger
# git config user.email danger@users.noreply.github.com

# Write formula
echo "class DangerJs < Formula" > danger-js.rb
Expand All @@ -35,11 +34,4 @@ echo "end" >> danger-js.rb
# Commit changes
git add danger-js.rb
git commit -m "Releasing danger-js version ${VERSION}"
git push origin "${BRANCH}"

# Open a pull request
curl -H "Authorization: token ${GITHUB_TOKEN}" \
-XPOST -d "{\"title\":\"Release danger-js ${VERSION}\",\"base\":\"master\", \"head\":\"${BRANCH}\"}" \
https://api.github.com/repos/danger/homebrew-tap/pulls

rm -rf "$HOMEBREW_TAP_TMPDIR"
git push origin master

0 comments on commit b478682

Please sign in to comment.