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

Add description when creating a pr with "createOrUpdatePR" #1032

Merged
merged 1 commit into from
Apr 11, 2020

Conversation

sogame
Copy link
Contributor

@sogame sogame commented Apr 11, 2020

When updating the PR, the description is set correctly:

But it's missing when creating the PR.

@sogame sogame force-pushed the createOrUpdatePR_create_body branch from 9bb1ec5 to e6077a1 Compare April 11, 2020 21:41
@sogame sogame changed the title Add description when creating a pr wiht "createOrUpdatePR" Add description when creating a pr with "createOrUpdatePR" Apr 11, 2020
@sogame sogame force-pushed the createOrUpdatePR_create_body branch from e6077a1 to 94688fe Compare April 11, 2020 21:44
@danger-public
Copy link

Warnings
⚠️ These providers are missing from the README: bamboo

Generated by 🚫 dangerJS against 94688fe

@orta
Copy link
Member

orta commented Apr 11, 2020

Looks good - thanks for the fix! I guess because I used it with peril it was always running multiple times

@orta orta merged commit f58ee85 into danger:master Apr 11, 2020
@sogame
Copy link
Contributor Author

sogame commented Apr 12, 2020

Hi @orta ,
So it actually works for you when running it multiple times?

If if do a new push (so the build triggers again), instead of updating the PR Danger fails with a GitHub error complaining that "Reference already exists":

Error:  RequestError [HttpError]: Reference already exists
    at /home/travis/build/sogame/danger-plugin-toolbox/node_modules/@octokit/request/dist-node/index.js:66:23
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  name: 'HttpError',
  status: 422,
  headers: {
    'access-control-allow-origin': '*',
    'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
    connection: 'close',
    'content-length': '121',
    'content-security-policy': "default-src 'none'",
    'content-type': 'application/json; charset=utf-8',
    date: 'Sun, 12 Apr 2020 12:00:59 GMT',
    'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
    server: 'GitHub.com',
    status: '422 Unprocessable Entity',
    'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
    vary: 'Accept-Encoding, Accept, X-Requested-With',
    'x-accepted-oauth-scopes': 'repo',
    'x-content-type-options': 'nosniff',
    'x-frame-options': 'deny',
    'x-github-media-type': 'github.v3; format=json',
    'x-oauth-scopes': 'repo',
    'x-ratelimit-limit': '5000',
    'x-ratelimit-remaining': '4895',
    'x-xss-protection': '1; mode=block'
  },
  request: {
    method: 'POST',
    url: 'https://api.github.com/repos/sogame/danger-plugin-toolbox/git/refs',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit.js/16.43.1 Node.js/12.13.1 (Linux 4.15; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"ref":"refs/heads/test_danger_new","sha":"3ddbe2dcc7a303c1ddb4eba030dd00194d3249ac"}',
    request: { hook: [Function: bound bound register], validate: [Object] }
  },
  documentation_url: 'https://developer.github.com/v3/git/refs/#create-a-reference'
}
danger-results://tmp/danger-results.json

@peril-staging
Copy link
Contributor

peril-staging bot commented Apr 16, 2020

Thanks for the PR @sogame.

This PR has been shipped in v10.1.1 - CHANGELOG.

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

Successfully merging this pull request may close these issues.

None yet

3 participants