This repository houses a conceptual prototype demonstrating the potential appearance and functionality of the CircleCI Slack orb, reimplemented in Go. Please note that this version is exploratory and not intended to supplant the original orb, nor is it advisable to utilize this in production environments. Explore, understand, and experiment, but proceed with caution when integrating it into practical applications. 🛠✨
In order to use the Slack Orb on CircleCI you will need to create a Slack App and provide an OAuth token. Find the guide in the wiki: How to setup Slack orb
For full usage guidelines, see the Orb Registry listing.
The Slack Orb comes with a number of included templates to get your started with minimal setup. Feel free to use an included template or create your own.
Template Preview | Template | Description |
---|---|---|
basic_success_1 | Should be used with the "pass" event. | |
basic_fail_1 | Should be used with the "fail" event. | |
success_tagged_deploy_1 | To be used in the event of a successful deployment job. see orb usage examples |
- Open the Slack Block Kit Builder: https://app.slack.com/block-kit-builder/
- Design your desired notification message.
- Replace any placeholder values with $ENV environment variable strings.
- Set the resulting code as the value for your
custom
parameter.
- slack/notify:
event: always
custom: |
{
"blocks": [
{
"type": "section",
"fields": [
{
"type": "plain_text",
"text": "*This is a text notification*",
"emoji": true
}
]
}
]
}
Limit Slack notifications to particular branches with the "branch_pattern" or "tag_pattern" parameter.
A comma separated list of regex matchable branch or tag names. Notifications will only be sent if sent from a job from these branches/tags. By default ".+" will be used to match all branches/tags. Pattern must match the full string, no partial matches. Keep in mind that "branch_pattern" and "tag_pattern" are mutually exclusive.
See usage examples.
View the FAQ in the wiki
We welcome issues to and pull requests against this repository!
For further questions/comments about this or other orbs, visit CircleCI's orbs discussion forum.
This repository is configured as a monorepo, containing the orb
source code, which is a collection of BASH
and CircleCI YAML
, and the cli
source code, which is the main go
binary utilized by this orb.
- Clone this repository
- Install taskfile.dev if you do not have it.
- HOMEBREW:
brew install go-task/tap/go-task
- NPM:
npm install -g @go-task/cli
- CHOCOLATEY:
choco install go-task
- HOMEBREW:
- Run
task sync
to download dependencies. - Before pushing your branch, ensure to run
task tidy