Skip to content

Commit

Permalink
Fix for git-release
Browse files Browse the repository at this point in the history
  • Loading branch information
javuto committed Feb 25, 2020
1 parent 8d1b0eb commit 53fea87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/git-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ fi

BODY="Release $TAG"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REPO=$(git config --get remote.origin.url | sed 's/.*:\/\/github.com\///;s/.git$//')
REPO=$(git config --get remote.origin.url | sed 's/.git//g' | awk -F":" '{print $2}' | cut -d'/' -f2)
OWNER=$(git config --get remote.origin.url | sed 's/.git//g' | awk -F":" '{print $2}' | cut -d'/' -f1)

generate_post_data()
{
Expand All @@ -35,9 +36,12 @@ echo

read -p " -> Github token? " TOKEN

_URL="https://api.github.com/repos/$OWNER/$REPO/releases?access_token=$TOKEN"

echo "[+] Sending POST request to Github API"
echo "[+] $_URL"
echo

curl --data "$(generate_post_data)" "https://api.github.com/repos/$REPO/releases?access_token=$TOKEN"
curl --data "$(generate_post_data)" "$_URL"

echo "[+] Done"

0 comments on commit 53fea87

Please sign in to comment.