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

Fix #219: either use the bot token or the webhook URL #220

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

filmaj
Copy link
Contributor

@filmaj filmaj commented Jun 27, 2023

... 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?

@filmaj filmaj added the bug Something isn't working label Jun 27, 2023
@filmaj filmaj added this to the 1.25 milestone Jun 27, 2023
@filmaj filmaj self-assigned this Jun 27, 2023
Copy link
Member

@seratch seratch left a 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!

Copy link
Member

@stevengill stevengill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@zimeg zimeg left a 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!

@filmaj filmaj modified the milestones: 1.25, 1.26 Jan 26, 2024
@zimeg zimeg modified the milestones: 1.26, 1.27 Apr 19, 2024
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

Successfully merging this pull request may close these issues.

If both webhook URL and bot token are specified, action will run twice
4 participants