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

[BUG] Crash if commit starts with '*' #76

Closed
AthAshino opened this issue Aug 3, 2023 · 1 comment · Fixed by #103
Closed

[BUG] Crash if commit starts with '*' #76

AthAshino opened this issue Aug 3, 2023 · 1 comment · Fixed by #103
Labels
bug Something isn't working released

Comments

@AthAshino
Copy link

Hi,

I tried to use semantic-release-gitmoji today and had this exception:
An error occurred while running semantic-release: SyntaxError: Invalid regular expression: /^*/: Nothing to repeat
After searching a bit, I found that this commit was the source of the exception:
*Merge branch 'main' of ssh://GIT_URL into main
The problem seems to be due to the emojiRegex. The regex returns "*" which lead to a bad regex for this line:
subject = subject.replace(new RegExp('^' + gitmoji), '')

Global workflow:
const matched = emojiRegex().exec(subject) subject = *Merge branch 'main' of ssh://GIT_URL into main
if (!matched || matched.index !== 0) return null
const gitmoji = matched[0] gitmoji = *
const semver = gitmojis.find(matchEmoji(gitmoji))?.semver || 'other'
subject = subject.replace(new RegExp('^' + gitmoji), '')

AthAshino pushed a commit to AthAshino/semantic-release-gitmoji that referenced this issue Aug 4, 2023
AthAshino pushed a commit to AthAshino/semantic-release-gitmoji that referenced this issue Aug 4, 2023
AthAshino pushed a commit to AthAshino/semantic-release-gitmoji that referenced this issue Aug 4, 2023
AthAshino added a commit to AthAshino/semantic-release-gitmoji that referenced this issue Aug 4, 2023
AthAshino added a commit to AthAshino/semantic-release-gitmoji that referenced this issue Aug 8, 2023
AthAshino added a commit to AthAshino/semantic-release-gitmoji that referenced this issue Aug 8, 2023
@momocow momocow added the bug Something isn't working label Oct 16, 2023
@inazuma-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 1.6.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
3 participants