Skip to content

Commit

Permalink
Merge pull request #123 from mokshadharma/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gm3dmo authored Nov 21, 2023
2 parents 6e4a29d + 2363172 commit 0a89dff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
6 changes: 4 additions & 2 deletions create-release.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/rest/reference/repos#create-a-release
# https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release
# POST /repos/:owner/:repo/releases

json_file=tmp/create-release.json
timestamp=$(date +%s)
draft="false"
prerelease="false"
generate_release_notes="true"

Expand All @@ -13,9 +14,10 @@ jq -n \
--arg commitish "${base_branch}" \
--arg name "Release 1 ($timestamp)" \
--arg prerelease ${prerelease} \
--arg draft ${draft} \
--arg generate_release_notes ${generate_release_notes} \
--arg body "The first and possibly last ever release." \
'{tag_name : $tag, target_commitish: $commitish, name: $name, generate_release_notes: $generate_release_notes | test("true"), body: $body, prerelease: $prerelease | test("true")}' > ${json_file}
'{tag_name : $tag, target_commitish: $commitish, name: $name, generate_release_notes: $generate_release_notes | test("true"), body: $body, draft: $draft | test("true"), prerelease: $prerelease | test("true")}' > ${json_file}

#cat $json_file | jq -r >&2

Expand Down
20 changes: 20 additions & 0 deletions get-a-release-by-tag-name.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-a-release-by-tag-name
# GET /repos/{owner}/{repo}/releases/tags/{tag}


# If the script is passed an argument $1 use that as the name
if [ -z "$1" ]
then
tag=$tag
else
tag=$1
fi


curl ${curl_custom_flags} \
-H "X-GitHub-Api-Version: ${github_api_version}" \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
"${GITHUB_API_BASE_URL}/repos/${owner}/${repo}/releases/tags/${tag}"

0 comments on commit 0a89dff

Please sign in to comment.