From aecfe96fd57757364657db960f48feef21b3ab42 Mon Sep 17 00:00:00 2001 From: David Morris Date: Thu, 11 Jan 2024 20:31:40 +0000 Subject: [PATCH] Adding list-custom-property-values-for-organization-repositories.sh --- ...ty-values-for-organization-repositories.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 list-custom-property-values-for-organization-repositories.sh diff --git a/list-custom-property-values-for-organization-repositories.sh b/list-custom-property-values-for-organization-repositories.sh new file mode 100755 index 00000000..8c1a6daa --- /dev/null +++ b/list-custom-property-values-for-organization-repositories.sh @@ -0,0 +1,23 @@ +. ./.gh-api-examples.conf + +# https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-properties?apiVersion=2022-11-28#list-custom-property-values-for-organization-repositories +# GET /orgs/{org}/properties/values + + +# If the script is passed an argument $1 use that as the name +if [ -z "$1" ] + then + org=$org + else + org=$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}/orgs/${org}/properties/values" + +# use this for querying a repo: +# "${GITHUB_API_BASE_URL}/orgs/${org}/properties/values?repository_query=repo-2404480%20in:name"