jpmcb / prow-github-actions

Slash commands, jobs, and chat-ops for Github actions inspired by Kubernetes Prow ⚓️
MIT License
92 stars 10 forks source link

[Feature] Surface org membership errors #39

Open jpmcb opened 2 years ago

jpmcb commented 2 years ago

In this chunk, when checking the membership of the commenter:

try {
    if (context.payload.repository === undefined) {
      core.debug(`checkOrgMember error: context payload repository undefined`)
      return false
    }

    await octokit.orgs.checkMembership({
      org: context.payload.repository.owner.login,
      username: user
    })

    return true
  } catch (e) {
    return false
  }

We don't surface the error when it's thrown. This would be really useful information, especially since GitHub org and Auth stuff can be really really tricky.