action-semantic-pull-request icon indicating copy to clipboard operation
action-semantic-pull-request copied to clipboard

Custom types not matching as expected

Open Indemnity83 opened this issue 10 months ago โ€ข 4 comments

Describe the bug

I defined custom types that include an emoji, but when I run the action the validation fails even though the PR title uses one of the type options and it is unclear why the workflow doesn't think it matches.

To reproduce

Setup custom types with emoji's:

with:
  types: |
    โœจ feat
    ๐Ÿ› fix
    ๐Ÿ“ docs
    ๐Ÿ’Ž style
    โ™ป๏ธ refactor
    ๐Ÿ“ˆ perf
    ๐Ÿงช test
    ๐Ÿ—๏ธ build
    ๐Ÿ“ฆ ci
    ๐Ÿงน chore
    โช๏ธ revert

Generate a PR with one of these types in the title "๐Ÿ“ฆ ci: run tests"

Expected behavior

I'd expect this to pass validation, but it fails with the following message:

No release type found in pull request title "๐Ÿ“ฆ ci: run tests". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - โœจ feat
 - ๐Ÿ› fix
 - ๐Ÿ“ docs
 - ๐Ÿ’Ž style
 - โ™ป๏ธ refactor
 - ๐Ÿ“ˆ perf
 - ๐Ÿงช test
 - ๐Ÿ—๏ธ build
 - ๐Ÿ“ฆ ci
 - ๐Ÿงน chore
 - โช๏ธ revert

Indemnity83 avatar Apr 12 '24 16:04 Indemnity83

This might be a duplicate of https://github.com/amannn/action-semantic-pull-request/issues/257

amannn avatar Apr 15 '24 08:04 amannn

Digging a bit deeper, it looks like an issue with the regex used by conventional-commit-parser. It expects a single word.

/^(\w*)(?:(([\w$.-* ])))?: (.)$/

That library also appears to be 8 years without an update so not much point in trying to fix that.

Possibly, would need to replace that library with something like https://commitlint.js.org/api/lint

Indemnity83 avatar Apr 15 '24 13:04 Indemnity83

That library also appears to be 8 years without an update so not much point in trying to fix that.

conventional-commits-parser? It looks actively maintained to me, no?

amannn avatar Apr 19 '24 10:04 amannn

Hi. The latest version 6.0.0, but you used the 3.2.x version. I have a same problem, i try use gitmoji icons before commit types, but I try header regexp config change, it is doesn't works.

buglavecz avatar May 25 '24 21:05 buglavecz