Skip to content

Commit

Permalink
fix: check if regexp match is null in label-pr script (paradigmxyz#7654)
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Nordbjerg <[email protected]>
  • Loading branch information
AbnerZheng and onbjerg authored Apr 15, 2024
1 parent c59c417 commit fc4bb53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/scripts/label_pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = async ({ github, context }) => {
const pattern = new RegExp(`(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved) ${repoUrl}/issues/(?<issue_number>\\d+)`, 'i')

const re = prBody.match(pattern);
const issueNumber = re.groups?.issue_number;
const issueNumber = re?.groups?.issue_number;

if (!issueNumber) {
console.log("No issue reference found in PR description.");
Expand Down

0 comments on commit fc4bb53

Please sign in to comment.