Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Create a deployment
create_gh_deployment () {
-H 'Content-Type: application/json' \
-H 'Accept: application/vnd.github.ant-man-preview+json' \
-d "{"ref": "${CIRCLE_SHA1}", "environment": "${environment}", "required_contexts": [], "auto_merge": false}"
# Run this function when you trigger a deploy.
# Keep track of the deployment id as $gh_deploy_id for later. We're using to parse the JSON to grab the id.
declare -r created_gh_deployment=$(create_gh_deployment)
declare -r gh_deploy_id=$(echo $created_gh_deployment | jq .id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment