Created
March 29, 2017 03:44
-
-
Save linyows/5e3bdc11eb2c7c994a0985d11bb8e039 to your computer and use it in GitHub Desktop.
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 | |
pr_id=$(git log | grep 'Merge pull request' | head -n 1 | sed -e 's/[^0-9]//g') | |
repo=$(git remote get-url origin | sed -e 's/ssh:\/\/git@.*\/\(.*\)\/\(.*\).git/\1\/\2/') | |
title=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \ | |
${GITHUB_API}repos/${repo}/pulls/${pr_id} | grep title | sed -e 's/.*".*": "\(.*\)",/\1/g') | |
echo $title |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment