-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinggh-apirelating to the gh api commandrelating to the gh api commandneeds-user-inputplatformProblems with the GitHub platform rather than the CLI clientProblems with the GitHub platform rather than the CLI client
Description
Describe the bug
Version : gh version 2.48.0
Using the gh api command to create ruleset, it is impossible to pass anything other than a string as a "key=value" pair. I tried using -F flag but it does not work either.
Here's an example:
gh api -X POST \
-H "Accept: application/vnd.github+json"\
-H "X-GitHub-Api-Version: 2022-11-28"\
repos/$owner/$repo/rulesets\
-f "name=Test"\
-f "target=branch"\
-f "enforcement=active"\
-f "rules[][type]=pull_request"\
-F "rules[][parameters][required_approving_review_count]=1"I get the following error:
{
"message": "Invalid request.\n\nInvalid property /rules/0: data matches no possible input. See `documentation_url`.",
"documentation_url": "https://docs.github.com/rest/repos/rules#create-a-repository-ruleset"
}I get the same behavior when i try with a property that should have a boolean value. For example:
gh api -X POST \
-H "Accept: application/vnd.github+json"\
-H "X-GitHub-Api-Version: 2022-11-28"\
repos/$owner/$repo/rulesets\
-f "name=Test"\
-f "target=branch"\
-f "enforcement=active"\
-f "rules[][type]=pull_request"\
-F "rules[][parameters][dismiss_stale_reviews_on_push]=true"Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggh-apirelating to the gh api commandrelating to the gh api commandneeds-user-inputplatformProblems with the GitHub platform rather than the CLI clientProblems with the GitHub platform rather than the CLI client