Skip to content

Instantly share code, notes, and snippets.

@pazdera
Created October 17, 2018 17:06
Show Gist options
  • Save pazdera/5cf7363668df982afebc8496f6b6ddbd to your computer and use it in GitHub Desktop.
Save pazdera/5cf7363668df982afebc8496f6b6ddbd to your computer and use it in GitHub Desktop.
Create a github release for an existing tag from the command line
#!/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