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

doc: how to reply to a message #309

Merged
merged 6 commits into from
May 28, 2024
Merged

Conversation

WilliamBergamin
Copy link
Contributor

Summary

This resolved #187

This PR adds documentation describing how to reply to an existing message and a unit test to ensure the behavior is maintained

Requirements

Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

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

Left a few suggestions for the README but other than that LGTM!

README.md Outdated
@@ -211,6 +212,37 @@ Please note that **the message update step does not accept a channel name.** Set
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
```

#### Reply to a message

If you want to post a message as a reply, you can populate the `payload` with a `"thread_ts"` field. The steps after the first message posting can have `"thread_ts": "${{ steps.slack.outputs.ts }}"` in their payload. In order to reply to an existing message.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you want to post a message as a reply, you can populate the `payload` with a `"thread_ts"` field. The steps after the first message posting can have `"thread_ts": "${{ steps.slack.outputs.ts }}"` in their payload. In order to reply to an existing message.
If you want to post a message as a threaded reply, you can populate the `payload` with a `thread_ts` field. This field should equal the `ts` value of the parent message of the thread. If you want to reply to a message previously posted by this Action, you can use the `ts` output provided as the `thread_ts` of a consequent threaded reply, e.g. `"thread_ts": "${{ steps.slack.outputs.ts }}"`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Committed this along with the other changes 🙇

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link

codecov bot commented May 28, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Co-authored-by: Fil Maj <fmaj@slack-corp.com>
Co-authored-by: Fil Maj <fmaj@slack-corp.com>
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.

🙌 This is great! Found something small in the payload that might need changing before a merge, but the instructions read well and I find this super helpful - I was excited to find a threaded message! 🚀

README.md Outdated Show resolved Hide resolved
@zimeg
Copy link
Member

zimeg commented May 28, 2024

🤔 I'm also open to updating the example, but no blocker at all. The deployment "started/completed" makes sense for updating a message (it makes sense for threading too), but wondering if this could post "a new commit was made" with commit details in thread instead? Or extending the current example to also reply_broadcast the message to channel?

Just some thoughts, feel free to ignore!

Co-authored-by: Ethan Zimbelman <ethan.zimbelman@me.com>
@fleytman
Copy link

fleytman commented Jun 3, 2024

Can u publicate new release of slack-github-action with these changes?

@WilliamBergamin
Copy link
Contributor Author

WilliamBergamin commented Jun 3, 2024

@fleytman this PR added documentation and a unit test to the project, it did not change its behavior, you should be able to use this functionality with the existing released version

@zimeg let me know if we should cut a release, I'm not familiar with the documentation distribution

@zimeg
Copy link
Member

zimeg commented Jun 3, 2024

@fleytman @WilliamBergamin called it with this being available in the current version v1.26.0 (and a few releases before if I had to guess). This example in the README should be good to paste into a workflow you have, taking care to note the thread_ts value!

No other fixes or enhancements have landed since this current release and this appears in the current README, so I think we're alright to wait for another release for now 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support thread_ts for threaded updates to a single topic
4 participants