Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/semantic_release_jira/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ module.exports = {
const jiraRegex = /\[(AEA-\d+)\]/g

for (const commit of commits) {
const matches = commit.message.match(jiraRegex)
const firstLine = commit.message?.split("\n", 1)[0] ?? ""
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit.message?.split("\n", 1)[0] doesn’t actually guard against commit.message being null/undefined: the optional chain only applies to the .split(...) call, and indexing [0] on an undefined result would throw. Either remove the optional chaining/nullish coalescing if commit.message is always a string, or make the access fully safe (e.g., optional chain the index access or coerce commit.message to an empty string before splitting).

Suggested change
const firstLine = commit.message?.split("\n", 1)[0] ?? ""
const firstLine = (commit.message ?? "").split("\n", 1)[0]

Copilot uses AI. Check for mistakes.
const matches = firstLine.match(jiraRegex)
if (matches) {
matches.forEach(t => jiraTickets.add(t))
}
Expand Down
Loading