Created
October 17, 2018 17:06
-
-
Save pazdera/5cf7363668df982afebc8496f6b6ddbd to your computer and use it in GitHub Desktop.
Create a github release for an existing tag from the command line
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
#!/usr/bin/env bash | |
# https://developer.github.com/v3/repos/releases/#create-a-release | |
repo=$1 | |
tag=$2 | |
name=$3 | |
text=$4 | |
token=$GH_TOKEN | |
generate_post_data() | |
{ | |
cat <<EOF | |
{ | |
"tag_name": "$tag", | |
"name": "$name", | |
"body": "$text", | |
"draft": false, | |
"prerelease": false | |
} | |
EOF | |
} | |
curl --data "$(generate_post_data)" "https://api.github.com/repos/$repo/releases?access_token=$token" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment