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

Can't add a custom prefix that has space in it e.g BREAKING CHANGE #257

Open
pof-jhansilva opened this issue Feb 14, 2024 · 1 comment
Open

Comments

@pof-jhansilva
Copy link

Is your feature request related to a problem? Please describe.

Hey, so we are using semantic-release to create our Github Releases using the following prefix table

image

I wanted to add BREAKING CHANGE: as a valid prefix because semantic-release uses it to create major/breaking releases but when I try it it just errors out.

Example of configuration:

- name: Validate semantic title 🔡
        uses: amannn/action-semantic-pull-request@v5
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          types: |
            fix
            feat
            perf
            BREAKING CHANGE

But even after adding that it still errors out with:

Error: No release type found in pull request title "BREAKING CHANGE". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - fix
 - feat
 - perf
 - BREAKING CHANGE
 

Describe the solution you'd like

Be able to add BREAKING CHANGE as an acceptable prefix so we can use it together with this action

Describe alternatives you've considered

Using perf prefix that is accepted by the conventionalcommits but sometimes this doesn't reflect the type of change that we are introducing.

@amannn
Copy link
Owner

amannn commented Feb 15, 2024

Hmm, interesting. If you'd be interested in analyzing this and potentially setting up a PR, I'd be happy to review it. The only thing we document is that the types need to be newline-delimited:

          # Configure which types are allowed (newline-delimited).
          # Default: https://github.com/commitizen/conventional-commit-types
          types: |
            fix
            feat

This is the corresponding parsing logic:

const ENUM_SPLIT_REGEX = /\n/;
module.exports = {
parseEnum(input) {
return input
.split(ENUM_SPLIT_REGEX)
.map((part) => part.trim())
.filter((part) => part.length > 0);
},

As an alternative, you can use the exclamation mark syntax that is used by Conventional Commits to indicate breaking changes (see the readme).

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