{"id":19722930,"url":"https://github.com/cloudposse/slack-notifier","last_synced_at":"2025-06-26T09:05:06.882Z","repository":{"id":29312302,"uuid":"120956686","full_name":"cloudposse/slack-notifier","owner":"cloudposse","description":"Command line utility to send messages with attachments to Slack channels via Incoming Webhooks","archived":false,"fork":false,"pushed_at":"2024-04-26T19:39:58.000Z","size":300,"stargazers_count":71,"open_issues_count":4,"forks_count":17,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-05-01T11:21:52.999Z","etag":null,"topics":["bot","cicd","cli","docker","environment-variables","golang","notifications","slack"],"latest_commit_sha":null,"homepage":"https://cloudposse.com/accelerate","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudposse.png","metadata":{"funding":{"github":"cloudposse"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-09T21:18:02.000Z","updated_at":"2024-05-03T15:27:26.382Z","dependencies_parsed_at":"2022-08-03T07:01:43.451Z","dependency_job_id":"5749d124-ee0a-432c-a8cc-c1f8b14a669b","html_url":"https://github.com/cloudposse/slack-notifier","commit_stats":{"total_commits":11,"total_committers":6,"mean_commits":"1.8333333333333333","dds":0.6363636363636364,"last_synced_commit":"4c14184fb1ebc77f1745ebf561338f883a8297c9"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudposse%2Fslack-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudposse%2Fslack-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudposse%2Fslack-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudposse%2Fslack-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudposse","download_url":"https://codeload.github.com/cloudposse/slack-notifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251592936,"owners_count":21614445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","cicd","cli","docker","environment-variables","golang","notifications","slack"],"created_at":"2024-11-11T23:19:01.357Z","updated_at":"2025-04-29T22:30:49.247Z","avatar_url":"https://github.com/cloudposse.png","language":"Go","funding_links":["https://github.com/sponsors/cloudposse"],"categories":[],"sub_categories":[],"readme":"# slack-notifier\n\n\nCommand line utility to send messages with [attachments](https://api.slack.com/docs/message-attachments)\nto [Slack](https://slack.com) channels via [Incoming Webhooks](https://api.slack.com/incoming-webhooks).\n\n\n![GitHub Commit Status](images/slack-notification-example.png)\n\n\n## Usage\n\n__NOTE__: The module accepts parameters as command-line arguments or as ENV variables\n(or any combination of command-line arguments and ENV vars).\nCommand-line arguments take precedence over ENV vars.\n\n\n__NOTE__: The module supports up to 8 Fields in an [attachment](https://api.slack.com/docs/message-attachments)\n###\n\n\n| Command-line argument |  ENV var            |  Description                                                                                                                         |\n|:----------------------|:--------------------|:-------------------------------------------------------------------------------------------------------------------------------------|\n| webhook_url           | SLACK_WEBHOOK_URL   | Slack [Webhook URL](https://get.slack.help/hc/en-us/articles/115005265063-Incoming-WebHooks-for-Slack)                               |\n| user_name             | SLACK_USER_NAME     | Slack user name (the username from which the messages will be sent)                                                                  |\n| icon_emoji            | SLACK_ICON_EMOJI    | Slack icon [emoji](https://www.webpagefx.com/tools/emoji-cheat-sheet) for the user's avatar                                          |\n| fallback              | SLACK_FALLBACK      | A plain-text summary of the attachment. This text will be used in clients that don't show formatted text                             |\n| color                 | SLACK_COLOR         | An optional value that can either be one of `good`, `warning`, `danger`, or a color code (_e.g._ `#439FE0`)                          |\n| channel               | SLACK_CHANNEL       | Slack channel to send to                                                                                                             |\n| thread                | SLACK_THREAD        | Slack channel thread to send to                                                                                                      |\n| pretext               | SLACK_PRETEXT       | Optional text that appears above the message attachment block                                                                        |\n| author_name           | SLACK_AUTHOR_NAME   | Small text to display the attachment author's name                                                                                   |\n| author_link           | SLACK_AUTHOR_LINK   | URL that will hyperlink the author's name. Will only work if `author_name` is present                                                |\n| author_icon           | SLACK_AUTHOR_ICON   | URL of a small 16x16px image to the left of the author's name. Will only work if `author_name` is present                            |\n| title                 | SLACK_TITLE         | The `title` is displayed as larger, bold text near the top of a message attachment                                                   |\n| title_link            | SLACK_TITLE_LINK    | URL for the `title` text to be hyperlinked                                                                                           |\n| text                  | SLACK_TEXT          | Main text in a message attachment                                                                                                    |\n| thumb_url             | SLACK_THUMB_URL     | URL to an image file that will be displayed as a thumbnail on the right side of a message attachment                                 |\n| footer                | SLACK_FOOTER        | Brief text to help contextualize and identify an attachment                                                                          |\n| footer_icon           | SLACK_FOOTER_ICON   | URL of a small icon beside the `footer` text                                                                                         |\n| image_url             | SLACK_IMAGE_URL     | URL to an image file that will be displayed inside a message attachment                                                              |\n| field1_title          | SLACK_FIELD1_TITLE  | Field1 title                                                                                                                         |\n| field1_value          | SLACK_FIELD1_VALUE  | Field1 value                                                                                                                         |\n| field1_short          | SLACK_FIELD1_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n| field2_title          | SLACK_FIELD2_TITLE  | Field2 title                                                                                                                         |\n| field2_value          | SLACK_FIELD2_VALUE  | Field2 value                                                                                                                         |\n| field2_short          | SLACK_FIELD2_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n| field3_title          | SLACK_FIELD3_TITLE  | Field3 title                                                                                                                         |\n| field3_value          | SLACK_FIELD3_VALUE  | Field3 value                                                                                                                         |\n| field3_short          | SLACK_FIELD3_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n| field4_title          | SLACK_FIELD4_TITLE  | Field4 title                                                                                                                         |\n| field4_value          | SLACK_FIELD4_VALUE  | Field4 value                                                                                                                         |\n| field4_short          | SLACK_FIELD4_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n| field5_title          | SLACK_FIELD5_TITLE  | Field5 title                                                                                                                         |\n| field5_value          | SLACK_FIELD5_VALUE  | Field5 value                                                                                                                         |\n| field5_short          | SLACK_FIELD5_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n| field6_title          | SLACK_FIELD6_TITLE  | Field6 title                                                                                                                         |\n| field6_value          | SLACK_FIELD6_VALUE  | Field6 value                                                                                                                         |\n| field6_short          | SLACK_FIELD6_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n| field7_title          | SLACK_FIELD7_TITLE  | Field7 title                                                                                                                         |\n| field7_value          | SLACK_FIELD7_VALUE  | Field7 value                                                                                                                         |\n| field7_short          | SLACK_FIELD7_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n| field8_title          | SLACK_FIELD8_TITLE  | Field8 title                                                                                                                         |\n| field8_value          | SLACK_FIELD8_VALUE  | Field8 value                                                                                                                         |\n| field8_short          | SLACK_FIELD8_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n| field9_title          | SLACK_FIELD9_TITLE  | Field9 title                                                                                                                         |\n| field9_value          | SLACK_FIELD9_VALUE  | Field9 value                                                                                                                         |\n| field9_short          | SLACK_FIELD9_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n| field10_title          | SLACK_FIELD10_TITLE  | Field10 title                                                                                                                         |\n| field10_value          | SLACK_FIELD10_VALUE  | Field10 value                                                                                                                         |\n| field10_short          | SLACK_FIELD10_SHORT  | An optional boolean indicating whether the `value` is short enough to be displayed side-by-side with other values (default `false`)  |\n\n### build the Go program locally\n\n```sh\ngo get\n\nCGO_ENABLED=0 go build -v -o \"./dist/bin/slack-notifier\" *.go\n```\n\n\n### run locally with ENV vars\n\n```sh\nexport SLACK_WEBHOOK_URL=\"https://hooks.slack.com/services/XXXXXXXX/XXXXXXXX/XXXXXXXXXXXXXXXXXXXXXX\"\nexport SLACK_USER_NAME=\"CodeFresh\"\nexport SLACK_ICON_EMOJI=\":white_check_mark:\"\nexport SLACK_FALLBACK=\"Deployed to Staging environment\"\nexport SLACK_COLOR=\"good\"\nexport SLACK_PRETEXT=\"Added XYZ to feature-104\"\nexport SLACK_AUTHOR_NAME=\"Auto Deploy Robot\"\nexport SLACK_AUTHOR_LINK=\"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/small-cute-robot-square.png\"\nexport SLACK_AUTHOR_ICON=\"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/small-cute-robot-square.png\"\nexport SLACK_TITLE=\"Environment Updated\"\nexport SLACK_TITLE_LINK=\"http://demo1.cloudposse.com\"\nexport SLACK_TEXT=\"The latest changes have been deployed\"\nexport SLACK_THUMB_URL=\"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/SquareLogo2.png\"\nexport SLACK_FOOTER=\"Helm Deployment\"\nexport SLACK_FOOTER_ICON=\"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/kubernetes.png\"\nexport SLACK_FIELD1_TITLE=\"Environment\"\nexport SLACK_FIELD1_VALUE=\"Staging\"\nexport SLACK_FIELD1_SHORT=\"true\"\nexport SLACK_FIELD2_TITLE=\"Namespace\"\nexport SLACK_FIELD2_VALUE=\"feature-104\"\nexport SLACK_FIELD2_SHORT=\"true\"\n\n./dist/bin/slack-notifier\n```\n\n\n### run locally with command-line arguments\n\n```sh\n./dist/bin/slack-notifier \\\n    -webhook_url \"https://hooks.slack.com/services/XXXXXXXX/XXXXXXXX/XXXXXXXXXXXXXXXXXXXXXX\" \\\n    -user_name \"CodeFresh\" \\\n    -icon_emoji \":white_check_mark:\" \\\n    -fallback \"Deployed to Staging environment\" \\\n    -color \"good\" \\\n    -pretext \"Added XYZ to feature-104\" \\\n    -author_name \"Auto Deploy Robot\" \\\n    -author_link \"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/small-cute-robot-square.png\" \\\n    -author_icon \"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/small-cute-robot-square.png\" \\\n    -title \"Environment Updated\" \\\n    -title_link \"http://demo1.cloudposse.com\" \\\n    -text \"The latest changes have been deployed\" \\\n    -thumb_url \"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/SquareLogo2.png\" \\\n    -footer \"Helm Deployment\" \\\n    -footer_icon \"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/kubernetes.png\" \\\n    -field1_title \"Environment\" \\\n    -field1_value \"Staging\" \\\n    -field1_short true \\\n    -field2_title \"Namespace\" \\\n    -field2_value \"feature-104\" \\\n    -field2_short true\n```\n\n\n\n### build the Docker image\n__NOTE__: it will download all `Go` dependencies and then build the program inside the container (see [`Dockerfile`](Dockerfile))\n\n\n```sh\ndocker build --tag slack-notifier  --no-cache=true .\n```\n\n\n\n### run in a Docker container with ENV vars\n\n```sh\ndocker run -i --rm \\\n    -e SLACK_WEBHOOK_URL=\"https://hooks.slack.com/services/XXXXXXXX/XXXXXXXX/XXXXXXXXXXXXXXXXXXXXXX\" \\\n    -e SLACK_USER_NAME=\"CodeFresh\" \\\n    -e SLACK_ICON_EMOJI=\":white_check_mark:\" \\\n    -e SLACK_FALLBACK=\"Deployed to Staging environment\" \\\n    -e SLACK_COLOR=\"good\" \\\n    -e SLACK_PRETEXT=\"Added XYZ to feature-104\" \\\n    -e SLACK_AUTHOR_NAME=\"Auto Deploy Robot\" \\\n    -e SLACK_AUTHOR_LINK=\"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/small-cute-robot-square.png\" \\\n    -e SLACK_AUTHOR_ICON=\"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/small-cute-robot-square.png\" \\\n    -e SLACK_TITLE=\"Environment Updated\" \\\n    -e SLACK_TITLE_LINK=\"http://demo1.cloudposse.com\" \\\n    -e SLACK_TEXT=\"The latest changes have been deployed\" \\\n    -e SLACK_THUMB_URL=\"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/SquareLogo2.png\" \\\n    -e SLACK_FOOTER=\"Helm Deployment\" \\\n    -e SLACK_FOOTER_ICON=\"https://cloudposse.com/wp-content/uploads/sites/29/2018/02/kubernetes.png\" \\\n    -e SLACK_FIELD1_TITLE=\"Environment\" \\\n    -e SLACK_FIELD1_VALUE=\"Staging\" \\\n    -e SLACK_FIELD1_SHORT=\"true\" \\\n    -e SLACK_FIELD2_TITLE=\"Namespace\" \\\n    -e SLACK_FIELD2_VALUE=\"feature-104\" \\\n    -e SLACK_FIELD2_SHORT=\"true\" \\\n    slack-notifier\n```\n\n\n\n## References\n* https://get.slack.help/hc/en-us/articles/115005265063-Incoming-WebHooks-for-Slack\n* https://api.slack.com/incoming-webhooks\n* https://api.slack.com/docs/message-attachments\n* https://api.slack.com/docs/message-formatting\n* https://www.webpagefx.com/tools/emoji-cheat-sheet\n\n\n## Help\n\n**Got a question?**\n\nFile a GitHub [issue](https://github.com/cloudposse/slack-notifier/issues), send us an [email](mailto:hello@cloudposse.com) or reach out to us on [Gitter](https://gitter.im/cloudposse/).\n\n\n## Contributing\n\n### Bug Reports \u0026 Feature Requests\n\nPlease use the [issue tracker](https://github.com/cloudposse/slack-notifier/issues) to report any bugs or file feature requests.\n\n### Developing\n\nIf you are interested in being a contributor and want to get involved in developing `slack-notifier`, we would love to hear from you! Shoot us an [email](mailto:hello@cloudposse.com).\n\nIn general, PRs are welcome. We follow the typical \"fork-and-pull\" Git workflow.\n\n 1. **Fork** the repo on GitHub\n 2. **Clone** the project to your own machine\n 3. **Commit** changes to your own branch\n 4. **Push** your work back up to your fork\n 5. Submit a **Pull request** so that we can review your changes\n\n**NOTE:** Be sure to merge the latest from \"upstream\" before making a pull request!\n\n\n## License\n\n[APACHE 2.0](LICENSE) © 2018 [Cloud Posse, LLC](https://cloudposse.com)\n\nSee [LICENSE](LICENSE) for full details.\n\n    Licensed to the Apache Software Foundation (ASF) under one\n    or more contributor license agreements.  See the NOTICE file\n    distributed with this work for additional information\n    regarding copyright ownership.  The ASF licenses this file\n    to you under the Apache License, Version 2.0 (the\n    \"License\"); you may not use this file except in compliance\n    with the License.  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing,\n    software distributed under the License is distributed on an\n    \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n    KIND, either express or implied.  See the License for the\n    specific language governing permissions and limitations\n    under the License.\n\n\n## About\n\n`slack-notifier` is maintained and funded by [Cloud Posse, LLC][website].\n\n![Cloud Posse](https://cloudposse.com/logo-300x69.png)\n\n\nLike it? Please let us know at \u003chello@cloudposse.com\u003e\n\nWe love [Open Source Software](https://github.com/cloudposse/)!\n\nSee [our other projects][community]\nor [hire us][hire] to help build your next cloud platform.\n\n  [website]: https://cloudposse.com/\n  [community]: https://github.com/cloudposse/\n  [hire]: https://cloudposse.com/contact/\n\n\n### Contributors\n\n| [![Erik Osterman][erik_img]][erik_web]\u003cbr/\u003e[Erik Osterman][erik_web] | [![Andriy Knysh][andriy_img]][andriy_web]\u003cbr/\u003e[Andriy Knysh][andriy_web] |\n|-------------------------------------------------------|------------------------------------------------------------------|\n\n  [erik_img]: http://s.gravatar.com/avatar/88c480d4f73b813904e00a5695a454cb?s=144\n  [erik_web]: https://github.com/osterman/\n  [andriy_img]: https://avatars0.githubusercontent.com/u/7356997?v=4\u0026u=ed9ce1c9151d552d985bdf5546772e14ef7ab617\u0026s=144\n  [andriy_web]: https://github.com/aknysh/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudposse%2Fslack-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudposse%2Fslack-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudposse%2Fslack-notifier/lists"}