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

Providing a PR description breaks custom releaseRules #535

Open
MBR41 opened this issue Sep 26, 2023 · 1 comment
Open

Providing a PR description breaks custom releaseRules #535

MBR41 opened this issue Sep 26, 2023 · 1 comment

Comments

@MBR41
Copy link

MBR41 commented Sep 26, 2023

Hi all, my intention is to release a new patch version when the commit message doesn't start with fix: or feat:.

These custom releaseRules work, except when the PR contains a description. PRs are created using Azure DevOps.

package.json

"release": {
    "plugins": [
        [
            "@semantic-release/commit-analyzer",
            {
                "preset": "angular",
                "releaseRules": [
                    {
                        "subject": "**",
                        "release": "patch"
                    },
                    {
                        "message": "**",
                        "release": "patch"
                    },
                    {
                        "tag": "**",
                        "release": "patch"
                    },
                    {
                        "type": "**",
                        "release": "patch"
                    }
                ]
            }
        ]
    ]
}

Pipeline logs

[semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merged PR 1135: PR with no description
[semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: Merged PR 1134: Another PR

With a description
[semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 2 commits complete: patch release

Workaround

Issue #339 has a workaround, which is to specify one rule without a subject, message, tag or type:

"release": {
    "plugins": [
        [
            "@semantic-release/commit-analyzer",
            {
                "preset": "angular",
                "releaseRules": [
                    {
                        "release": "patch"
                    }
                ]
            }
        ]
    ]
}

This works with and without PR descriptions present, however commits starting with feat: no longer increment the minor version:

[semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: feat: Another PR
[semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
[semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 1 commits complete: patch release

Package Versions

"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/npm": "^10.0.4",
"@semantic-release/release-notes-generator": "^11.0.4",
"semantic-release": "^22.0.5"
@httran13
Copy link

httran13 commented Dec 6, 2023

have you tried adding body:"**"

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