You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing the script,
we get the following errors :
"Invalid request.\n\nNo subschema in \"anyOf\" matched.\n\"restrictions\" wasn't supplied.\nFor 'items', \"lint-test / lint-test\" is not an object.\nNot all subschemas of \"allOf\" matched.\nFor 'anyOf/1', {\"strict\"=>true, \"checks\"=>[\"lint-test / lint-test\"]} is not a null.",
"documentation_url": "https://docs.github.com/rest/branches/branch-protection#update-branch-protection"
Looking at the documentation, required_status_checks requires a "context" key and not a "checks" key
We are also not getting all existing repositories when we do :
API_URL="https://api.github.com/orgs/${ORG_NAME}/repos?type=public"
# get list of all public repos
RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
"${API_URL}")
REPOS=$(echo "${RESPONSE}" | jq -r '.[].full_name')
since GitHub's API paginates the responses. If we have more repositories than the default per-page limit (usually 30), not all repositories will be returned in a single API call.
The text was updated successfully, but these errors were encountered:
SonOfLope
changed the title
Error using branch-protection-ruleset.sh script
As a Devops, I would like to be able to use the script to automate branch protection ruleset
Mar 6, 2024
When executing the script,
we get the following errors :
Looking at the documentation, required_status_checks requires a "context" key and not a "checks" key
Also, we are missing a comma at the end of "require_code_owner_reviews": true :
Which results in error parsing JSON.
We are also not getting all existing repositories when we do :
since GitHub's API paginates the responses. If we have more repositories than the default per-page limit (usually 30), not all repositories will be returned in a single API call.
The text was updated successfully, but these errors were encountered: