Updating branch protection: expected map type under "required_status_checks", got []interface {} #124344
Unanswered
zandatzu
asked this question in
API and Webhooks
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
Hello,
I am trying to update branch protection rules on a repo through
gh api
but I keep getting the same error message and can't find anything about it. My request is formatted like this:gh api \ --method PUT \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ /repos/OWNER/REPO/branches/BRANCH/protection \ -F "required_status_checks[strict]=true" \ -f "required_status_checks[contexts[]]=build" \ -F "enforce_admins=false" \ -f "dismissal_restrictions[users[]]=null" \ -f "dismissal_restrictions[teams[]]=null" \ -F "required_pull_request_reviews[dismiss_stale_reviews]=true" \ -F "required_pull_request_reviews[require_code_owner_reviews]=false" \ -F "required_pull_request_reviews[required_approving_review_count]=1" \ -F "required_pull_request_reviews[require_last_push_approval]=false" \ -f "bypass_pull_request_allowances[users[]]=null" \ -f "bypass_pull_request_allowances[teams[]]=null" \ -f "restrictions[users[]]=null" \ -f "restrictions[teams[]]=team1" \ -f "restrictions[apps[]]=null" \ -F "require_linear_history=false" \ -F "allow_force_pushes=true" \ -F "allow_deletions=false" \ -F "block_creations=false" \ -F "required_conversation_solution=false" \ -F "lock_branch=false" \ -F "allow_fork_syncing=false"
It throws the error message:
expected map type under "required_status_checks", got []interface {}
Beta Was this translation helpful? Give feedback.
All reactions