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

I need to include other commits than feat and fix. #403

Open
tomavic opened this issue Dec 29, 2022 · 3 comments
Open

I need to include other commits than feat and fix. #403

tomavic opened this issue Dec 29, 2022 · 3 comments

Comments

@tomavic
Copy link

tomavic commented Dec 29, 2022

Hi Help wanted 🆘

I have a react app configured with GithubPages. I need to include commits like chore, style, refactor ..etc in the generated CHANGELOG.

This is my config .releaserc.json

{
  "branches": [
    { "name": "main" },
    { "name": "pre/rc", "channel": "pre/rc", "prerelease": "rc" },
    { "name": "beta", "channel": "beta", "prerelease": true }
  ],
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "angular",
        "releaseRules": [
          { "type": "docs", "release": "patch" },
          { "type": "refactor", "release": "patch" },
          { "type": "style", "release": "patch" },
          { "type": "ci", "release": "patch" },
          { "type": "chore", "release": "patch" }
        ]
      }
    ],
    [
      "@semantic-release/release-notes-generator",
      {
        "parserOpts": {
          "noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
        },
        "preset": "conventionalcommits", // I used angular preset and failed too 
        "presetConfig": {
          "types": [
            {
              "type": "breaking",
              "section": "❗ Breaking ❗",
              "hidden": false
            },
            { "type": "feat", "section": "✨ Feature ✨", "hidden": false },
            { "type": "fix", "section": "🐛 Bugfix 🐛", "hidden": false },
            { "type": "hotfix", "section": "🔥 Hotfix 🔥", "hidden": false },
            {
              "type": "BREAKING",
              "section": "❗ Breaking ❗",
              "hidden": false
            },
            { "type": "HOTFIX", "section": "🔥 Hotfix 🔥", "hidden": false }
          ]
        }
      }
    ],
    [
      "@semantic-release/changelog",
      {
        "changelogFile": "CHANGELOG.md"
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": ["CHANGELOG.md"],
        "message": "build: 🚀 ${nextRelease.gitTag} has been released \n\n${nextRelease.notes}"
      }
    ],
    [
      "@semantic-release/github",
      {
        "assets": ["dist/assets/**"]
      }
    ]
  ]
}

and this is the generated CHANGELOG.md

# 1.0.0 (2022-12-29)

### Features

- :sparkles: add 404 not found page ([3c862d3](https://github.com/tomavic/myreads-tracker/commit/3c862d39c7723715b2397908ab63b7d154d1daf6))
- :sparkles: add book details page ([556caca](https://github.com/tomavic/myreads-tracker/commit/556caca2e4086330cc9c2fe95fa94db3f1871491))
- :sparkles: add project files ([7805ac1](https://github.com/tomavic/myreads-tracker/commit/7805ac18bf1eee3da4549fb935cf2c943c217a86))
- :sparkles: first commit ([1a4b6f3](https://github.com/tomavic/myreads-tracker/commit/1a4b6f3b0fc33c94f78598aa3558daf2b4b06516))
- :sparkles: style and favicon ([9501b1c](https://github.com/tomavic/myreads-tracker/commit/9501b1c7f0a19814129c8f73952d475bc377d3c6))
- :sparkles: use `useRoutes` ([adbd18f](https://github.com/tomavic/myreads-tracker/commit/adbd18f34e13f18c72388474e42af20541cb1ab5))
@CynanX
Copy link

CynanX commented Jan 19, 2023

Do you not just need to add ‘chore’ into your release-generator types?

{"type": "chore", "hidden": true},

@tomavic
Copy link
Author

tomavic commented Jan 21, 2023

I already did that, please check the demo project

https://github.com/tomavic/myreads-tracker/blob/main/CHANGELOG.md

@tomavic
Copy link
Author

tomavic commented Feb 5, 2023

I found the solution after many searches here #153

My searches has fall to mathieudutour/github-tag-action#68 and I noticed that I must remove the default preset Angular and add "preset": "conventionalcommits", and install the conventional-changelog-conventionalcommits from here https://www.npmjs.com/package/conventional-changelog-conventionalcommits

This part is not clear in the documentation

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