Created
August 25, 2019 06:04
-
-
Save sparverius/4e68a5c37013b2864e38e907d45e2178 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 | |
version=$1 | |
text=$2 | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
repo_full_name=$(git config --get remote.origin.url | sed 's/.*:\/\/github.com\///;s/.git$//') | |
token=$(git config --global github.token) | |
generate_post_data() | |
{ | |
cat <<EOF | |
{ | |
"tag_name": "$version", | |
"target_commitish": "$branch", | |
"name": "$version", | |
"body": "$text", | |
"draft": false, | |
"prerelease": false | |
} | |
EOF | |
} | |
echo "Create release $version for repo: $repo_full_name branch: $branch" | |
curl --data "$(generate_post_data)" "https://api.github.com/repos/$repo_full_name/releases?access_token=$token" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment