ravsamhq / notify-slack-action

🔔 Send a Slack Notification from Github Actions regarding failure, warnings, or even success.
https://ravsam.in/blog/send-slack-notification-when-github-actions-fails/
MIT License
173 stars 57 forks source link

string pattern only get replaced once #66

Closed tomlau10 closed 1 year ago

tomlau10 commented 2 years ago

Hi,

I am constructing a workflow with slack notification requirement and come across this great action library today 👍 However I find a very small issue, the string pattern only get replaced once

This is possibly due to makeMessage() is using string.replace instead of string.replaceAll https://github.com/ravsamhq/notify-slack-action/blob/master/src/main.ts#L30

For this reason, pattern cannot be used more than once eg: notification_title: '{emoji} Server Deploy Failed {emoji}' only the first {emoji} will get replaced

ravsam-bot[bot] commented 2 years ago

Hello and welcome to RavSam :purple_heart:. Thanks for opening your first issue. I will assign one of our team members to take a look at the problem you have raised. Make sure to include as much information as possible to help our team diagnose the issue and solve it quickly.

If the problem is related to a security concern, then please delete this issue and send us an email at info@ravsam.in.

ravgeetdhillon commented 2 years ago

@tomlau10 Thanks for reporting this bug. This bug is now fixed in v2.1.1. Let us know if it solves your problem.