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

Add thread_id to on-hold job #458

Merged
merged 6 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jobs:
executor: <<parameters.runner>>
steps:
- checkout
- slack/notify:
debug: true
step_name: "Initial message with thread"
template: basic_success_1
event: always
thread_id: orb-testing-thread-<${CIRCLE_SHA1}>
- slack/notify:
debug: true
step_name: "Custom template with group mention"
Expand Down Expand Up @@ -232,6 +238,12 @@ workflows:
matrix:
parameters:
runner: [cimg, mac, alpine, windows]
- slack/on-hold:
context: SLACK_NOTIFICATIONS_TEST
debug: true
step_name: "On hold with thread"
template: basic_success_1
thread_id: orb-testing-thread-<${CIRCLE_SHA1}>
- orb-tools/pack:
filters: *release-filters
- orb-tools/publish:
Expand Down
9 changes: 9 additions & 0 deletions src/jobs/on-hold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ parameters:
type: string
default: Slack - Sending Notification
description: Specify a custom step name for this command, if desired
thread_id:
type: string
default: ""
description: |
When set, the first `notify` with a given `thread_id` will appear as a regular slack message.
Any subsequent `notify` usage with the same identifier will be posted within the initial message's thread.
`thread_id` should be set to any arbitrary string to help you identify different threads. See examples for more information.
Enabling thread messages with this parameter implies using a very small amount of cacheing: ~200 B

docker:
- image: cimg/base:stable
Expand All @@ -72,3 +80,4 @@ steps:
debug: <<parameters.debug>>
circleci_host: <<parameters.circleci_host>>
step_name: <<parameters.step_name>>
thread_id: <<parameters.thread_id>>