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

Including entire commit body in release note #332

Open
nhidtran opened this issue Apr 14, 2022 · 3 comments
Open

Including entire commit body in release note #332

nhidtran opened this issue Apr 14, 2022 · 3 comments

Comments

@nhidtran
Copy link

nhidtran commented Apr 14, 2022

Hello! When the commit below gets analyzed and outputted on the release note, only the commit title is outputted. Is it possible to include the additional commit description/body in the release note?

Screen Shot 2022-04-13 at 8 54 20 PM

release.config.js

const verifyConditions = [
  [
    "@semantic-release/changelog",
    {
      changelogFile: "CHANGELOG.md"
    }
  ],
  [
    "@semantic-release/git",
    {
      assets: ["CHANGELOG.md"]
    }
  ]
];
const analyzeCommits = [
  [
    "@semantic-release/commit-analyzer",
    {
      preset: "angular",
      releaseRules: [
        {
          // e.g.: next upgrade, large refactors, removing large chunks of code
          type: "breaking",
          release: "major"
        },
        {
          // e.g.: next upgrade, large refactors, removing large chunks of code
          type: "BREAKING",
          release: "major"
        },
        {
          // e.g. the new new hottest features
          type: "feat",
          release: "minor"
        },
        {
          // e.g. bugfixes
          type: "fix",
          release: "patch"
        },
        {
          // commits that need to be released outside of the release process
          type: "hotfix",
          release: "patch"
        },
        {
          // commits that need to be released outside of the release process
          type: "HOTFIX",
          release: "patch"
        },
        // you needed to revert a commit on dev or main
        {
          type: "revert",
          release: "patch"
        },
        // added jest or E2E tests
        {
          type: "test",
          release: false
        },
        // e.g. removing code comments
        {
          type: "chore",
          release: false
        },
        // e.g. edits/new markdown files
        {
          type: "docs",
          release: false
        },
        // e.g. feat(no-release): will skip release based off of type
        {
          subject: "no-release:",
          release: false
        }
      ],
      parserOpts: {
        noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES"]
      }
    }
  ]
];

const generateNotes = [
  [
    "@semantic-release/release-notes-generator",
    {
      preset: "conventionalcommits",
      presetConfig: {
        issuePrefixes: [
          "#",
          "CAR-",
          "GRO-",
        ],
        issueUrlFormat:
          "https://atlassian.net/browse/{{prefix}}{{id}}",
        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 },
          // !  The following are capitalized to grab attention
          { type: "BREAKING", section: "❗ Breaking ❗", hidden: false },
          { type: "HOTFIX", section: "🔥 Hotfix 🔥", hidden: false }
        ],
        userUrlFormat: "https://github.com/FooBar/{{user}}"
      }
    }
  ]
];
const prepare = [
  "@semantic-release/changelog",
  [
    "@semantic-release/npm",
    {
      // this here is just for package.log update
      npmPublish: false
    }
  ],
  [
    "@semantic-release/git",
    {
      assets: ["package.json", "CHANGELOG.md"],
      message:
        /* eslint-disable no-template-curly-in-string */
        "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
    }
  ]
];
const publish = [["@semantic-release/github"]];

const verifyRelease = [];
const fail = [];
const success = [];
const addChannel = [];

module.exports = {
  repositoryUrl: "https://github.com/Foo/Bar",
  branches: [
    "main",
    {
      name: "next-RC",
      prerelease: false
    }
  ],
  defaultBranch: "main",
  verifyConditions,
  analyzeCommits,
  verifyRelease,
  generateNotes,
  prepare,
  publish,
  fail,
  success,
  addChannel
};

@Xiphe
Copy link

Xiphe commented May 31, 2023

Have you had any luck with this? I'd also love to have my commit bodies included in the changelog.

@DanielChrome
Copy link

Hi. Any news about it? I'm looking for a way to add more info but all my attemps fail.

I'm try to use conventionalcommits parser with the template below but keeps add just the header to release-notes

<type>(<optional scope>): <description>
empty separator line
<optional body>
empty separator line
<optional footer>

@kleinfreund
Copy link

I've also wanted this for a long time and managed to get it to work with the following configuration: https://github.com/kleinfreund/yet-another-color-picker/blob/77d49f41199eb5e1c8f29bb3e7e37d5d88819233/release.config.js#L5-L16 (which is admittedly not exactly simple). For more details, refer to my answer to a StackOverflow question asking for the same thing: https://stackoverflow.com/a/77548066/2036825

(I also opened an issue in conventional-changelog/conventional-changelog#1166 to simplify this approach, but without success.)

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

4 participants