https://github.com/lazy-actions/slatify
Slack Notification for GitHub Actions :bell:
https://github.com/lazy-actions/slatify
github-actions slack typescript
Last synced: about 2 months ago
JSON representation
Slack Notification for GitHub Actions :bell:
- Host: GitHub
- URL: https://github.com/lazy-actions/slatify
- Owner: lazy-actions
- License: mit
- Created: 2019-08-26T08:30:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-15T17:58:04.000Z (over 2 years ago)
- Last Synced: 2026-04-03T00:43:09.966Z (2 months ago)
- Topics: github-actions, slack, typescript
- Language: TypeScript
- Homepage:
- Size: 19.6 MB
- Stars: 132
- Watchers: 2
- Forks: 37
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slatify




[](https://github.com/prettier/prettier)
This is Slack Notification Action.
# Announcement
:rotating_light: Transferred repository from homoluctus :rotating_light:
We don't need to rename from homoluctus/slatify to lazy-actions/slatify in .github/workflow/*.yml.
You can use as it is, but we recommend renaming it to lazy-actions/slatify.
# ToC
- [Feature](#feature)
- [Inputs](#inputs)
- [Examples](#examples)
- [Basic usage](#basic-usage)
- [Includes the latest commit information](#includes-the-latest-commit-information)
- [Slack UI](#slack-ui)
- [LICENSE](#license)
## Feature
- Notify the result of GitHub Actions
- Support three job status (reference: [job-context](https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#job-context))
- success
- failure
- cancelled
- Mention
- Notify message to channel members efficiently
- You can specify the condition to mention
## Inputs
First of all, you need to set GitHub secrets for SLACK_WEBHOOK that is Incoming Webhook URL.
You can customize the following parameters:
|with parameter|required/optional|default|description|
|:--:|:--:|:--|:--|
|type|required|N/A|The result of GitHub Actions job
This parameter value must contain the following word:
- `success`
- `failure`
- `cancelled`
We recommend using ${{ job.status }}|
|job_name|required|N/A|Means slack notification title|
|url|required|N/A|Slack Incoming Webhooks URL
Please specify this key or SLACK_WEBHOOK environment variable
※SLACK_WEBHOOK will be deprecated|
|mention|optional|N/A|Slack message mention|
|mention_if|optional|N/A|The condition to mention
This parameter can contain the following word:
- `success`
- `failure`
- `cancelled`
- `always`|
|icon_emoji|optional|Use Slack Incoming Webhook configuration|Slack icon|
|username|optional|Use Slack Incoming Webhook configuration|Slack username|
|channel|optional|Use Slack Incoming Webhook configuration|Slack channel name|
|commit|optional|false|If true, slack notification includes the latest commit message and author.|
|token|case by case|N/A|This token is used to get commit data.
If commit parameter is true, this parameter is required.
${{ secrets.GITHUB_TOKEN }} is recommended.|
Please refer to [action.yml](./action.yml) for more details.
## Examples
### Basic usage
```..github/workflows/example1.yml
- name: Slack Notification
uses: lazy-actions/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: '*Test*'
channel: '#random'
url: ${{ secrets.SLACK_WEBHOOK }}
```
### Includes the latest commit information
```..github/workflows/example2.yml
- name: Slack Notification
uses: lazy-actions/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: '*Lint Check*'
mention: 'here'
mention_if: 'failure'
channel: '#random'
url: ${{ secrets.SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
```
## Slack UI

---

## LICENSE
[The MIT License (MIT)](https://github.com/lazy-actions/slatify/blob/master/LICENSE)