422 Target Validation Failed Error When Creating A Ruleset with targeted branches #119797
Replies: 1 comment 3 replies
-
Hey @lado936 , I noticed you resolved this, was there something you needed to do to get it working? I'm finding a similar issue trying to create rulesets with the github terraform provider. It allows me to set an include pattern of "master" via the UI, but when I try via the API I get
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Bug
Body
Hello, i am using go sdk to create Repository with Rulesets, while Ruleset creation is working okay, if i set target branches like "main" "test", i get below error
DEBUG events PUT https://api.github.com/repos/test/test/rulesets/6545754: 422 Validation Failed [{Resource: Field: Code: Message:Invalid target patterns: 'test', 'main'}]
after many trials and errors, i tried to set branches not like main, but as "refs/heads/main", this one worked, but issue is that now in repo settings i see targeted branches are set like "refs/heads/refs/heads/main".
So either API should allow setting branch patterns without refs/heads/ prefix, or it should not be appended after i am setting it on my side
Beta Was this translation helpful? Give feedback.
All reactions