Created
October 15, 2016 10:33
-
-
Save ijse/bd768d1c71e1f6056afd8c9ae9bf8b5a to your computer and use it in GitHub Desktop.
call github api to merge branches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Merge Github branch | |
# | |
# Usage: | |
# shells/merge-branch.sh <base-branch> <head-branch> [commit message] | |
request=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )/request.sh | |
# The name of the base branch that the head will be merged into. | |
base=$1 | |
# The head to merge. This can be a branch name or a commit SHA1. | |
head=$2 | |
# Commit message to use for the merge commit. If omitted, a default message will be used. | |
message=$3 | |
payload="{\"base\":\"$base\",\"head\":\"$head\",\"commit_message\":\"$message\"}" | |
echo "Call merge branch: $payload" | |
$request \ | |
POST \ | |
merges \ | |
$payload | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment