diff --git a/lib/actions/pullRequest.js b/lib/actions/pullRequest.js index 59654700..0cbf9c5f 100644 --- a/lib/actions/pullRequest.js +++ b/lib/actions/pullRequest.js @@ -11,16 +11,14 @@ exports.validatePR = async function validatePR({ pullRequest, issue }) { if (pullRequest) { const { number: pullNumber, - commits, base: { ref: baseRef, repo: { owner: { login: owner }, name: repo, }, - user: { login: committer }, }, - head: { ref: headRef, sha: headSha }, + head: { ref: headRef }, title, } = pullRequest; @@ -47,32 +45,6 @@ exports.validatePR = async function validatePR({ pullRequest, issue }) { ); } - if ( - commits === 1 && - !title.match(/^Revert ".*"/) && - !title.match(/^Bump .*/) && - committer !== "ms-bot" && - committer !== "ms-upgrade-aws" - ) { - // we have only one commit, make sure its name match the name of the PR - const { - data: { message: commitMessage }, - } = await octokit.rest.git.getCommit({ - owner, - repo, - commit_sha: headSha, - }); - if (commitMessage !== title) { - throw new Error( - `This pull request has only one commit, and its message doesn't match the title of the PR. If you'd like to keep the title of the PR as it is, please add an empty commit.` - ); - } else { - console.log( - "This pull request has only one commit, and its message matches the title of the PR." - ); - } - } - // everything seems valid: add the label if it exists const branchTag = headRef.split("/")[0];