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

Slack notification fails when apostrophe is used in commit message #424

Closed
fsintegrations opened this issue Aug 28, 2023 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@fsintegrations
Copy link

Orb version:

4.12.0

What happened:

Orb crashes with error unexpected EOF while looking for matching ''`
when the commit message or PR title contains an apostrophe

Expected behavior:

Slack notification should works fine even with apostrophe in message content

Additional Information:

Commit message that crashed the slack notification Adding flow to allowed attributes so that it's not skipped.
image

I could see this issue is already in closed state but we still face this issue if the commit message or PR title contains apostrophe (')
#186
#198

@fsintegrations fsintegrations added the bug Something isn't working label Aug 28, 2023
@EricRibeiro
Copy link
Contributor

EricRibeiro commented Oct 24, 2023

Hey @fsintegrations 👋

Thank you for bringing this to our notice, and sorry for not getting to it sooner. Special characters have been a recurring issue with this orb, and we have tried, without much success (😅), to escape them manually using Bash.

We are trying a different approach now. We have a proof-of-concept Slack orb wholly written in Go, which means that we can leverage built-in libraries to do the special characters escaping inside the JSON templates for us.

Would you be open to trying it and seeing if it solves your issue? We are looking for some early feedback. All you have to do is replace the orb version 4.12.0 in your config with dev:4463bcaee946c1e91829fdf6b3e0d1a7b6f12210:

version: 2.1

orbs:
-  slack: circleci/slack@4.12.0
+  slack: circleci/slack@dev:4463bcaee946c1e91829fdf6b3e0d1a7b6f12210

Please remember that dev:4463bcaee946c1e91829fdf6b3e0d1a7b6f12210 is a proof-of-concept, so it doesn't have feature parity with v4.12.0. As of the time of this writing, it doesn't support sub-shells expansions inside the templates:

{
    "blocks": [
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "$(cat /tmp/msg)"
            }
        }
    ]
}

Thanks in advance, and let us know if it works for you! 🙇

Warning
dev:4463bcaee946c1e91829fdf6b3e0d1a7b6f12210 will be deleted after 90 days (January 22, 2024). Remember to roll back to a production version before the developer version gets deleted.

@marboledacci
Copy link
Contributor

@fsintegrations I'm not very familiar with the historic of this issue, can you provide more details on how you are using the orb? I was trying to replicate with newer version using apostrophe everywhere and didn't get any error.

@marboledacci marboledacci self-assigned this Sep 11, 2024
@marboledacci
Copy link
Contributor

No more information has been provided so I'm closing this.

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

3 participants