Open goetzc opened 1 year ago
Hey @goetzc 👋
Thank you for bringing this to our notice, and sorry for not getting to it sooner. We have a proof-of-concept Slack orb wholly written in Go that will potentially solve this pattern-matching issue and some others.
Would you all be open to trying it and seeing if it solves your problem? We are looking for some early feedback. All you have to do is replace the orb version 4.12.5
in your config with dev:4463bcaee946c1e91829fdf6b3e0d1a7b6f12210
:
version: 2.1
orbs:
- slack: circleci/slack@4.12.5
+ 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.5
. 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.
Orb version: 4.12.5
What happened:
I want to avoid sending the notification on any branch trigger, including the default
main
branch. Only want to send notifications on workflows triggered by tags. So I have setbranch_pattern
andtag_pattern
to different values without success.Or according to the README https://github.com/CircleCI-Public/slack-orb/blob/3e43e753919b007d681cb2a16b37cabe5a8eda83/README.md?plain=1#L61
but it seems outdated as it's not working with:
Without any pattern (or using the
tag_pattern
) it send the notification. On any of thebranch_pattern
above, it fails with the following error:Which makes the whole job fail.
Expected behavior:
I expect it to avoid sending the notification on any branch (including the default branch), and exiting cleanly with code 0, so the whole workflow/job passes.
Additional Information:
I'm not sure if I'm missing something, as the normal job filters (
filters.tags.only
,filters.branches.only
orfilters.branches.ignore
) work normally. Is there some special pattern to avoid sending the notification on any branch?Thanks