github-release-notes icon indicating copy to clipboard operation
github-release-notes copied to clipboard

`template` doesn't impact output for some fields

Open Hatko opened this issue 7 years ago • 4 comments

We have a file .grenrc.js generated from gren int

After adding a template object it looks like this:

module.exports = {
    "dataSource": "milestones",
    "prefix": "n",
    "groupBy": "label",
    "milestoneMatch": "{{tag_name}}",
    "changelogFilename": "CHANGELOG.md",
    "template": {
        commit: ({ message, url, author, name }) => `- [${message}](${url}) - ${author ? `@${author}` : name}`,
        issue: "- {{labels}} {{name}} [{{text}}]({{url}})",
        label: "[**{{label}}**]",
        noLabel: "closed",
        group: "\n#### {{heading}}\n",
        changelogTitle: "# Changelog\n\n",
        release: "## {{release}} ({{date}})\n{{body}}",
        releaseSeparator: "\n---\n\n"
    }
}

When I change values for issue, label or group, the CHANGELOG.md file is still generated from the original template. Changing values for release and changelogTitle do impact though.

Hatko avatar Dec 27 '18 14:12 Hatko

Weird. I'll have a look.

What command are you running?

alexcanessa avatar Jan 09 '19 16:01 alexcanessa

@alexcanessa

yarn gren changelog

while having the script in package.json

"gren": "node ./node_modules/github-release-notes/bin/gren.js"

Hatko avatar Jan 10 '19 08:01 Hatko

@Hatko could you try to run it with --debug ?

alexcanessa avatar Jan 14 '19 09:01 alexcanessa

@alexcanessa the output is:

Options:
Tags: empty
Prefix: empty
Template: [object Object]
Prerelease: false
Generate: false
Quiet: false
Override: true
Debug: true
Ignore labels: empty
Ignore issues with: empty
Ignore commits with: empty
Group by: label
Milestone match: {{tag_name}}
Changelog filename: CHANGELOG.md
Username: connectedcars
Repo: mobile-app
Token: XXXXXXXXXXX (removed the token)
Limit: 50
Data source: milestones
Include messages: commits
Ignore tags with: empty

🤖  - Generate changelog file:
===================================
✔ Releases found: 1
✔ Changelog created in

Hatko avatar Jan 14 '19 12:01 Hatko