Creating a pull request from a repo to a fork (same organisation) using the GitHub-API

Viewed 30

I'm trying to create a pull request from my main-repo (A) to a fork (B) inside the same organisation on GitHub using the GitHub-API. I have two braches in both repos that are named identically. I tried it in several ways using the official documentation:

https://developer.github.com/v3/pulls/#create-a-pull-request

Either way I get the following 422 "Validation failed" error saying "No commits between branchXY and branchXY":

Postman-Screenshot

My body looks like this:

{
    "owner":  "ITS-Unibas-Choco",
    "repo":   "zzz-test-packages-inbox-filtered",
    "title":  "Automated PR",
    "head":   "unibas-swd-test:dev/test@1.2.3",
    "base":   "dev/test@1.2.3"
}

If I try to create a pull request via GitHub website that works fine (see screenshot), so I suppose it's a problem with the API / my way of using the API.

GitHub pull request via website (Screenshot)

By the way: I managed to create a pull request the same way using two different organisations. That also works perfectly fine!

0 Answers
Related