Skip to content

Commit

Permalink
fix: invalid backports when links are used (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored and MarshallOfSound committed Jun 22, 2019
1 parent 32d1188 commit 1b47f68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Expand Up @@ -105,8 +105,9 @@ PR is no longer targeting this branch for a backport',
// check if this PR is a manual backport of another PR
const backportPattern = /(?:^|\n)(?:manual |manually )?backport.*(?:#(\d+)|\/pull\/(\d+))/im;
const match: Array<string> | null = pr.body.match(backportPattern);
if (match && match[1]) {
backportNumber = parseInt(match[1], 10);
if (match) {
// This might be the first or second capture group depending on if it's a link or not
backportNumber = !!match[1] ? parseInt(match[1], 10) : parseInt(match[2], 10);
}
}

Expand Down

0 comments on commit 1b47f68

Please sign in to comment.