-
Notifications
You must be signed in to change notification settings - Fork 149
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
Fix #219: either use the bot token or the webhook URL #220
base: main
Are you sure you want to change the base?
Conversation
…webhook URL. Do not do both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; thanks for fixing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The TODO around returning message information for only one of many messages is a nice catch. I wonder if there's some slick way to include information of multiple messages 🤔
Maybe it is worth deferring this work to a v2 of this Action with a new API that more cleanly delineates these different behaviours?
I agree that a new API for this can be more clear, but don't think that should stop this PR!
Also wondering if a note in the README should be added to say something about the SLACK_BOT_TOKEN
taking priority over any SLACK_WEBHOOK_URL
? Unsure if the current behavior is relied upon, but this might save future confusions with this!
... but do not use both.
I believe this mainly affects this repo's integration tests. I was noticing that the bot-token based integration test (
integration_test_botToken
) was posting to a test channel of mine twice... turns out it was because I had both the bot token and a webhook URL defined as environment variables when testing locally.Fixes #219.
I think this may need some work, though. The intention in this fix is to ensure each time this action is consumed as a step, we don't do multiple things (post a message via the
postMessage
API and also HTTP POST to a webhook URL). However, the API in this Action for either posting message vs. HTTP POSTing to a webhook is very similar, and so it is hard to untangle the two if you want to use both in a single workflow action file. Maybe it is worth deferring this work to a v2 of this Action with a new API that more cleanly delineates these different behaviours?