title: Probot check-js pull request
body: <p>I'm building a code-review app for github using nodeJS (ProBot)</p>
  <p>I'm trying to get the pull_request data out of the check_suite that was created in order to get the relevant files and run my tests but the context.payload.pull_request is empty.</p>
  <p>i tried also listening to the event pull_request.created, there I have the data that I need but the context.github.checks.update() / context.github.checks.create() does not update the status of the check and and stays in_progress forever.</p>
  <p>here is my code :</p>
  <pre><code>module.exports = app =&gt; {
  app.on([
  'check_suite.requested',
  'check_run',
  'pull_request.opened', 
  ], check)
  async function check (context) {
  const startTime = new Date()
  
  if (context.payload.check_suite) {
    const { head_branch: headBranch, head_sha: headSha } = context.payload.check_suite
  
     return context.github.checks.create(context.repo({
      name: 'SoftaCheck',
      head_branch: headBranch,
      head_sha: headSha,
      status: 'in_progress',
      started_at: startTime,
    }))
  }
  
  const payload =  {head_branch: context.payload.pull_request? context.payload.pull_request.base.ref : context.payload.check_run.pull_requests[0].base.ref ,head_sha : context.payload.pull_request? context.payload.pull_request.base.sha : context.payload.check_run.pull_requests[0].base.sha }
  
  const { head_branch, head_sha } = payload
  
  if (context.payload.pull_request) {
      
     //some async code here in order to decide conclusion...
  
     context.github.checks.create(context.repo({
       name: 'SoftaCheck',
       head_branch,
       head_sha,
       status: 'completed',
       conclusion:'success'
       started_at: startTime,
     }))
  
  }
  </code></pre>
  <p>}</p>
  <p>// For more information on building apps:
  // <a href="https://probot.github.io/docs/" rel="nofollow noreferrer">https://probot.github.io/docs/</a></p>
  <p>// To get your app running against GitHub, see:
  // <a href="https://probot.github.io/docs/development/" rel="nofollow noreferrer">https://probot.github.io/docs/development/</a>
  }</p>