Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github API error when no commits exist between branches #37

Open
commscheck opened this issue Oct 22, 2021 · 0 comments
Open

Github API error when no commits exist between branches #37

commscheck opened this issue Oct 22, 2021 · 0 comments

Comments

@commscheck
Copy link

Steps to reproduce

Create .pr-train.yml:

trains:
  appsflyer:
    - ben-appsflyer-archx
    - ben-appsflyer-activation-events

Run the following:

git checkout -b branch-a
# make changes
git commit -a -m "commit message"
git checkout -b branch-b
git pr-train --create-prs

Expected

pr-train checks if all branches in a chain have different HEADs before pushing to Github

Actual

{
  "message": "Validation Failed",
  "statusCode": 422,
  "headers": {
    "server": "GitHub.com",
    "date": "Fri, 22 Oct 2021 04:49:49 GMT",
    "content-type": "application/json; charset=utf-8",
    "content-length": "261",
    "x-oauth-scopes": "repo",
    "x-accepted-oauth-scopes": "",
    "x-github-media-type": "github.v3; format=json",
    "x-ratelimit-limit": "5000",
    "x-ratelimit-remaining": "4962",
    "x-ratelimit-reset": "1634878448",
    "x-ratelimit-used": "38",
    "x-ratelimit-resource": "core",
    "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
    "access-control-allow-origin": "*",
    "strict-transport-security": "max-age=31536000; includeSubdomains; preload",
    "x-frame-options": "deny",
    "x-content-type-options": "nosniff",
    "x-xss-protection": "0",
    "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
    "content-security-policy": "default-src 'none'",
    "vary": "Accept-Encoding, Accept, X-Requested-With",
    "x-github-request-id": "REDACTED",
    "connection": "close"
  },
  "body": {
    "message": "Validation Failed",
    "errors": [
      {
        "resource": "PullRequest",
        "code": "custom",
        "message": "No commits between branch-a and branch-b"
      }
    ],
    "documentation_url": "https://docs.github.com/rest/reference/pulls#create-a-pull-request"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant