Skip to content

Commit

Permalink
feat: throw helpful error when authentication is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Sep 15, 2019
1 parent 10f353c commit 0391141
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/create-pull-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ async function createPullRequest(
) {
let response = await octokit.repos.get({ owner, repo });

if (!response.data.permissions) {
throw new Error("[octokit-create-pull-request] Missing authentication");
}

if (!base) {
base = response.data.default_branch;
}
Expand Down

0 comments on commit 0391141

Please sign in to comment.