github-tools / github-release-notes

Node module to create a release or a changelog from a tag and uses issues or commits to creating the release notes.
https://github-tools.github.io/github-release-notes/
GNU General Public License v3.0
880 stars 325 forks source link

Commit dates fix, release body and preview #287

Closed carlosouro closed 3 years ago

carlosouro commented 3 years ago

Base version documentation: https://github.com/github-tools/github-release-notes

Changes here:

TO-DO::

Running locally:

Custom .grenrc.js example

/* .grenrc.js */

module.exports = {
  template: {
    commit: ({ message, url, author, name }) => `- ${message}`,
    noLabel: "closed",
    group: "\n#### {{heading}}\n",
    changelogTitle: "# Changelog\n\n",
    release: "## {{release}} ({{date}})\n{{body}}",
    releaseSeparator: "\n---\n\n",
    releaseBody: ({ isoDate, body }) => {
      const date = new Date(isoDate);
      const dateStr = new Date(date - 8 * 60 * 60 * 1000).toLocaleString("en-US") + ' PST';
      //const dateStr = date.toLocaleString('en-US');
      return `${dateStr}\n${body}`
    },
  },
  ignoreCommitsWith: "^[0-9]+\.[0-9]+\.[0-9]+$",
  dataSource: "commits",
  includeMessages: "commits",
  changelogFilename: "CHANGELOG.md"
}