momocow / semantic-release-gitmoji

✨🐛💥 A semantic-release plugin for gitmojis. Different from conventional changelog, Gitmoji commits are used to determine a release type and generate release notes.
MIT License
90 stars 20 forks source link

Help: how to include a "Other changes" section in the hbs template #87

Open arkadioz opened 8 months ago

arkadioz commented 8 months ago

I am trying to modify the template to be able to identify any emoji that is not part of the defined sections, to be put in this "Other changes" section:

{{#if compareUrl}}
    # [v{{nextRelease.version}}]({{compareUrl}}) ({{datetime "UTC:yyyy-mm-dd"}})
{{else}}
    # v{{nextRelease.version}} ({{datetime "UTC:yyyy-mm-dd"}})
{{/if}}

{{#with commits}}
    {{#if sparkles}}
        ## ✨ New Features
        {{#each sparkles}}
            - {{> commitTemplate}}
        {{/each}}
    {{/if}}

    {{#if bug}}
        ## 🐛 Bug Fixes
        {{#each bug}}
            - {{> commitTemplate}}
        {{/each}}
    {{/if}}

    {{#if ambulance}}
        ## 🚑 Critical Hotfixes
        {{#each ambulance}}
            - {{> commitTemplate}}
        {{/each}}
    {{/if}}

    {{#if lock}}
        ## 🔒 Security Issues
        {{#each lock}}
            - {{> commitTemplate}}
        {{/each}}
    {{/if}}

    {{#if boom}}
        ## 💥 Breaking Changes
        {{#each boom}}
            - {{> commitTemplate}}
        {{/each}}
    {{/if}}

    {{#unless (or (eq this 'boom') (eq this 'lock') (eq this 'sparkles') (eq this 'bug') (eq this 'ambulance'))}}
        ## Other Changes
    {{/unless}}

{{/with}}

But when I run the workflow I get the following error (I am a little new to hbs so this "Other section" I made was with help of an AI, hopefully someone can help me correct it and add the desired section properly):

Error: Missing helper: "eq"

momocow commented 8 months ago

I think this requires some changes in the data structure of the context.

I'll consider it as an enhancement request.