{"id":20134372,"url":"https://github.com/wearerequired/slack-messaging-action","last_synced_at":"2025-04-09T17:20:37.282Z","repository":{"id":39393013,"uuid":"300601405","full_name":"wearerequired/slack-messaging-action","owner":"wearerequired","description":"💌 A GitHub Action for sending (and updating) messages of any layout and formatting from GitHub Actions to Slack.","archived":false,"fork":false,"pushed_at":"2024-05-01T04:43:53.000Z","size":812,"stargazers_count":21,"open_issues_count":5,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T19:22:13.315Z","etag":null,"topics":["bot","github-action","slack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wearerequired.png","metadata":{"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":"2020-10-02T12:03:19.000Z","updated_at":"2025-01-01T22:01:28.000Z","dependencies_parsed_at":"2024-02-03T15:29:01.775Z","dependency_job_id":"796f6c99-afa6-44b1-b7a9-dea33f7b4265","html_url":"https://github.com/wearerequired/slack-messaging-action","commit_stats":{"total_commits":98,"total_committers":4,"mean_commits":24.5,"dds":"0.37755102040816324","last_synced_commit":"27b8384cb9ffad7232beb8a4ecdfbb47a19efebf"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearerequired%2Fslack-messaging-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearerequired%2Fslack-messaging-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearerequired%2Fslack-messaging-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearerequired%2Fslack-messaging-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wearerequired","download_url":"https://codeload.github.com/wearerequired/slack-messaging-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074926,"owners_count":21043491,"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","github-action","slack"],"created_at":"2024-11-13T21:09:18.980Z","updated_at":"2025-04-09T17:20:37.256Z","avatar_url":"https://github.com/wearerequired.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack Messaging Action\n\nA GitHub Action for sending (and updating) messages of any layout and formatting from GitHub Actions to Slack. Inspired by [Slack Notify Build](https://github.com/marketplace/actions/slack-notify-build).\n\nA [Slack bot token](https://api.slack.com/docs/token-types) is required to use this action, and the associated app must be granted permission to post in the channel, private group or DM you specify.\n\n## Usage\n\n```yaml\nuses: wearerequired/slack-messaging-action@v2\nwith:\n  bot_token: ${{ secrets.SLACK_BOT_TOKEN }}\n  channel: deployments\n  payload: \u003e-\n    {\n        \"icon_emoji\": \":rocket:\",\n        \"username\": \"Deployer\",\n        \"text\": \"Deployment finished.\",\n        \"attachments\": [\n            {\n                \"author_name\": \"${{ github.event.sender.login }}\",\n                \"author_link\": \"${{ github.event.sender.html_url }}\",\n                \"author_icon\": \"${{ github.event.sender.avatar_url }}\",\n                \"color\": \"good\",\n                \"fields\": [\n                    {\n                      \"title\": \"Revision\",\n                      \"value\": \"\u003chttps://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}@${{ github.ref }}\u003e\",\n                      \"short\": true\n                    }\n                ],\n                \"footer\": \"\u003chttps://github.com/${{ github.repository }}|${{ github.repository }}\u003e\",\n            }\n        ]\n    }\n```\n\nIn `payload` you have to provide your own [rich message layout](https://api.slack.com/messaging/composing/layouts) which will be sent as is to Slack.\n\n### Updating an existing message\n\nIf you prefer to update a single message instead of posting multiple messages, you can pass a `message_id` to future steps.\n\nNote: You must assign a step `id` to the first Slack notification step in order to reference it for future steps:\n\n```yaml\n- name: Notify Slack about deployment start\n  if: success()\n  id: slack # IMPORTANT: Reference this step ID value in future Slack steps.\n  uses: wearerequired/slack-messaging-action@v2\n  with:\n    bot_token: ${{ secrets.SLACK_BOT_TOKEN }}\n    channel: deployments\n    payload: \u003e-\n      {\n          \"icon_emoji\": \":rocket:\",\n          \"username\": \"Deployer\",\n          \"text\": \"Deployment started.\"\n      }\n\n- name: Deployment\n\n- name: Notify Slack about deployment success\n  if: success() # You can use the conditional checks to determine which notification to send.\n  uses: wearerequired/slack-messaging-action@v2\n  with:\n    bot_token: ${{ secrets.SLACK_BOT_TOKEN }}\n    message_id: ${{ steps.slack.outputs.message_id }} # Updates existing message from the first step.\n    channel: deployments\n    payload: \u003e-\n      {\n          \"icon_emoji\": \":rocket:\",\n          \"username\": \"Deployer\",\n          \"text\": \"Deployment finished.\"\n      }\n\n- name: Notify Slack about deployment fail\n  if: failure() # You can use the conditional checks to determine which notification to send.\n  uses: wearerequired/slack-messaging-action@v2\n  with:\n    bot_token: ${{ secrets.SLACK_BOT_TOKEN }}\n    message_id: ${{ steps.slack.outputs.message_id }} # Updates existing message from the first step.\n    channel: deployments\n    payload: \u003e-\n      {\n          \"icon_emoji\": \":boom:\",\n          \"username\": \"Deployer\",\n          \"text\": \"Deployment failed.\"\n      }\n```\n\n## Inputs\n\n### `bot_token`\n\nA [bot token](https://api.slack.com/docs/token-types) associated with a Slack app. **Required**\n\n_Note_: The following bot token scopes are required: `chat:write`, `chat:write.customize`, `chat:write.public`, `channels:read`, and `groups:read`.\n\n### `channel`\n\nThe name of the channel to post the message to. **Required** if no `channel_id` is provided.\n\n_Note_: If your workspace has many channels, supplying only a `channel` may cause rate limiting issues with this GitHub Action. Consider supplying a `channel_id` instead.\n\n### `channel_id`\n\nThe ID of the channel to post the message to. **Required** if no `channel` is provided, or if you need to send to a DM.\n\n### `payload`\n\nThe [JSON payload of a message](https://api.slack.com/messaging/composing) to send. **Required**\n\n_Note_: `channel` and `ts` are set to the values of the respective inputs.\n\n### `message_id`\n\nThe ID of a previous Slack message to update instead of posting a new message. Typically passed using the `steps` context:\n\n```yaml\nmessage_id: ${{ steps.\u003cyour_first_slack_step_id\u003e.outputs.message_id }}\n```\n\n## Outputs\n\n### `message_id`\n\nReturns the unique message ID, which is a timestamp which can be passed to future Slack API calls as `ts`.\n\n## License\n\nThe scripts and documentation in this project are released under the [MIT license](LICENSE).\n\n\u003cbr\u003e\n\n[![a required open source product - let's get in touch](https://media.required.com/images/open-source-banner.png)](https://required.com/en/lets-get-in-touch/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearerequired%2Fslack-messaging-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwearerequired%2Fslack-messaging-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearerequired%2Fslack-messaging-action/lists"}