I am trying to create a Pull Request, using curl . y
The pull request source and target branch are in the same repo. (Not cros repository).
The source branch name is cd/apim-1.25.27, and the target branch name is master.
I keep having the following error, and tried every possibility for the head field format (the PR source branch name), but still can’t get to create a the PR…
My curl :
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ******" \
https://api.github.com/repos/MY_ORGANIZATION/My_REPOSITORY/pulls \
-d '{"title":"Amazing new feature","body":"Please pull these awesome changes in!","head":"cd/apim-1.25.27","base":"master"}'
I got this message from github api
{
"message": "Validation Failed",
"errors": [
{
"resource": "PullRequest",
"field": "head",
"code": "invalid"
}
],
"documentation_url": "https://docs.github.com/rest/reference/pulls#create-a-pull-request"