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

parse-commit-message: Type should be exact match #164

Open
ChocolateLoverRaj opened this issue Jun 11, 2021 · 1 comment
Open

parse-commit-message: Type should be exact match #164

ChocolateLoverRaj opened this issue Jun 11, 2021 · 1 comment

Comments

@ChocolateLoverRaj
Copy link

Support plan

  • which support plan is this issue covered by? (e.g. Community, Sponsor, or
    Enterprise): Community
  • is this issue currently blocking your project? (yes/no): Yes
  • is this issue affecting a production system? (yes/no): No

Context

  • node version: 14.16.0
  • module version: 3.2.3
  • environment (e.g. node, browser, native): node
  • used with (i.e. popular names of modules): https://github.com/semantic-release/semantic-release
  • any other relevant information: Using this package to add labels to PRs according to the increment of the commit messages.

What are you trying to achieve or the steps to reproduce?

I'm using Semantic Release to release my code. I'm writing my own GitHub Action to add / remove labels from GitHub PRs so I know what kind of release merging the PR will trigger. The script gets all the commit messages and uses the parse-commit-message module to get the increment type.

import { parse, plugins, applyPlugins } from 'parse-commit-message'

console.log(applyPlugins(plugins[1], parse('fixblahblahblah: Fixed a bug'))[0].increment) // Patch

Since fixblahblahblah stars with fix, the patch regex matches the type. Ran into this when using Feature: something was a minor but it didn't do anything with Semantic Release.

What was the result you got?

'patch'

What result did you expect?

false

@tunnckoCore
Copy link
Owner

tunnckoCore commented Aug 3, 2021

Hey, sorry for the late response.

It's not strictly a commit validation library. I built a whole suite around all that and even GitHub (Probot) Bots back then, completely freeing me of Semantic Release. That was the whole purpose - small separate components, following the Conventional Commits spec. Because we had problems with SR.

What can help you with Feature is adding options.caseSensitive: true. As about the other, you won't have such commit in the first place, if you have good git commit flow (i use gitcommit), docs for contrib, or you have commit linting like commitlint which have presets too, so you won't end up with wrong messages in git/github.

Thanks for using it. :)

https://github.com/tunnckoCoreLabs/new-release (new-release, @tunnckocore/release and @tunnckocore/release-cli)
https://github.com/standard-release
(duh... a lot of stuff, organizations and renaming...)

GitHub
[MIRROR] Publish project to NPM following Conventional Commits specification and SemVer. Uses git-commits-since for detecting git commits since last SemVer tag and `detect-next-version` for what ne...
GitHub
Automated workflow for language-independent module publishing and creating GitHub Releases, following the Conventional Commits and SemVer specifications - Standard Release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants