Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: invalid backports when links are used #108

Merged
merged 2 commits into from Jun 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/index.ts
Expand Up @@ -104,8 +104,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