diff --git a/lib/verify.js b/lib/verify.js index 9ba9af9e..5c1d0145 100644 --- a/lib/verify.js +++ b/lib/verify.js @@ -71,9 +71,7 @@ module.exports = async (pluginConfig, {options: {repositoryUrl}, logger}) => { const {name: repo, owner} = parseGithubUrl(repositoryUrl); if (!owner || !repo) { errors.push(getError('EINVALIDGITHUBURL')); - } - - if (githubToken) { + } else if (githubToken) { const github = getClient({githubToken, githubUrl, githubApiPathPrefix}); try { @@ -94,9 +92,12 @@ module.exports = async (pluginConfig, {options: {repositoryUrl}, logger}) => { throw err; } } - } else { + } + + if (!githubToken) { errors.push(getError('ENOGHTOKEN', {owner, repo})); } + if (errors.length > 0) { throw new AggregateError(errors); }