Skip to content

Instantly share code, notes, and snippets.

@IlyaFinkelshteyn
Created March 28, 2018 07:30
Show Gist options
  • Save IlyaFinkelshteyn/75770b3fafabe019986351c7cfb3f1d2 to your computer and use it in GitHub Desktop.
Save IlyaFinkelshteyn/75770b3fafabe019986351c7cfb3f1d2 to your computer and use it in GitHub Desktop.
#replace
$token = ""
$env:gh_user = ""
$env:gh_repo = ""
$tag_name = ""
$target_commitish = ""
$name = ""
$prerelease = $true/$false
body = ""
#end replace
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
$body = @{
tag_name = $tag_name
target_commitish = $target_commitish
name = $name
draft = $true # always true when we create release first time
prerelease = $prerelease
body = $body
}
$body = $body | ConvertTo-Json
Invoke-RestMethod -Uri "https://api.github.com/repos/$env:gh_user/$env:gh_repo/releases" -Headers $headers -Body $body -Method POST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment