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

Changelog Enforcer does not support github emojis? #284

Open
mathomp4 opened this issue Apr 11, 2024 · 6 comments
Open

Changelog Enforcer does not support github emojis? #284

mathomp4 opened this issue Apr 11, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@mathomp4
Copy link
Contributor

Describe the bug

Recently, a group I work with in trying to enforce our own order for Github Labels, added emojis as a workaround (since Github sees them as text underneath) so we can move, say, "Non 0 Diff" early in the label dropdown.

The issue is that it looks like changelog-enforcer doesn't handle Github emojis. For example, I have in my yaml file:

    - uses: dangoslen/changelog-enforcer@v3
      with:
        changeLogPath: 'CHANGELOG.md'
        skipLabels: "Changelog Skip,0 Diff Trivial,:wrench: Github Actions"
        missingUpdateErrorMessage: >
            No update to CHANGELOG.md found! Please add a changelog
            entry to it describing your change.  Please note that the
            keepachangelog (https://keepachangelog.com) format is
            used. If your change is very trivial not applicable for a
            changelog entry, add a 'Changelog Skip' label to the pull
            request to skip the changelog enforcer.

But it looks like when the enforcer runs, the colons around :wrench: are stripped...maybe:

Run dangoslen/changelog-enforcer@v3
  with:
    changeLogPath: CHANGELOG.md
    skipLabels: Changelog Skip,0 Diff Trivial,:wrench: Github Actions
...  
Skip Labels: Changelog Skip,0 Diff Trivial,wrench,Github Actions

So :wrench: Github Actions is now wrench,Github Actions

Expected behavior

That it recognizes the emoji'd labels.

A link to or sample of your workflow

You can see my testing here:

mathomp4/labeltest-github-actions#10

@mathomp4 mathomp4 added the bug Something isn't working label Apr 11, 2024
@mathomp4
Copy link
Contributor Author

Note it might be as simple as adding : as a char in:

const regex = new RegExp(/([\w\s-\/+\?;\[\]\(\)]+,?)/, 'g')

but I know nothing about JavaScript and maybe colons blow things up? 😄

@dangoslen
Copy link
Owner

I think you are right that this should be a simple Regex fix. Let me see what I can do.

@dangoslen
Copy link
Owner

I have a fix up in #285. If you want to test, you can always update your action temporarily to point at that branch, but I'm pretty positive via the test it will handle your use case

@mathomp4
Copy link
Contributor Author

I have a fix up in #285. If you want to test, you can always update your action temporarily to point at that branch, but I'm pretty positive via the test it will handle your use case

Looks like it worked! Plus I learned I can do:

uses: dangoslen/changelog-enforcer@allow-for-emojis-in-labels

which is good to know.

Thanks for the quick fix!

(Now I guess I debate whether to make a feature request...)

@dangoslen
Copy link
Owner

No need for a feature request. This is definitely a bug. I'll create a v3.6.1 release in a few moments

@github-actions github-actions bot mentioned this issue Apr 11, 2024
@mathomp4
Copy link
Contributor Author

No need for a feature request. This is definitely a bug. I'll create a v3.6.1 release in a few moments

Oh. I meant for something else I was thinking about, i.e., make a Github comment if the enforcer fails. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants