Skip to content

Commit

Permalink
Project Management Automation: Guard against non-matching commits in …
Browse files Browse the repository at this point in the history
…`addMilestone`. (#20147)

Fixes #20144.
  • Loading branch information
epiqueras authored Feb 10, 2020
1 parent 53e55a8 commit b62a3b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/project-management-automation/lib/add-milestone.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ async function addMilestone( payload, octokit ) {
return;
}

const [ , prNumber ] = payload.commits[ 0 ].message.match( /\(#(\d+)\)$/m );
const match = payload.commits[ 0 ].message.match( /\(#(\d+)\)$/m );
const prNumber = match && match[ 1 ];
if ( ! prNumber ) {
debug( 'add-milestone: Commit is not a squashed PR. Aborting' );
return;
Expand Down

0 comments on commit b62a3b3

Please sign in to comment.