semantic-release-slack-bot icon indicating copy to clipboard operation
semantic-release-slack-bot copied to clipboard

feat: allow onSuccessFunction/onFailFunction to be a promise

Open jochemkeller opened this issue 7 months ago • 0 comments

Hi,

Thanks for a great SR plug-in 🙏

It is seeing heavy usage in a corporate environment I work in, where I also ran into the issue that I'd like to asynchronously build the template using this library. However if for instance onSuccessFunction is a Promise, the slackMessage isn't awaited, resulting in a Promise { <pending> } being offered to the Slack API and of course this results in SemanticReleaseError: invalid_payload.

await Promise.resolve() wrappers for both onSuccessFunction & onFailFunction should allow us to input both Promises and sync functions.

If you have any thoughts please let me know!

jochemkeller avatar Jul 02 '24 19:07 jochemkeller