Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nighttwo1/fastlane-slack-message
A custom `fastlane` action to send messages to a Slack channel
https://github.com/nighttwo1/fastlane-slack-message
fastlane slack slack-webhook
Last synced: 22 days ago
JSON representation
A custom `fastlane` action to send messages to a Slack channel
- Host: GitHub
- URL: https://github.com/nighttwo1/fastlane-slack-message
- Owner: nighttwo1
- Created: 2024-06-05T15:47:21.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-07T11:04:28.000Z (7 months ago)
- Last Synced: 2024-10-25T02:38:44.380Z (2 months ago)
- Topics: fastlane, slack, slack-webhook
- Language: Ruby
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fastlane Action for slack message
Action for sending message with incoming webhook app in slack. Supports both simplified template and user customized block kit message.
# Example Output
This action will generate and send a message to Slack that looks like this:
# Usage
Here is an example of how to use this action in your `Fastfile`:
### 1. Use predefiend template
```ruby
lane :post_to_slack do
slack_message(
title: "새로운 안드로이드 앱이 배포되었습니다! 🚀",
sub_title: "Checkout for new version of android app!",
webhook_url: "https://hooks.slack.com/services/...",
payload: {
"버전" => "0.1.10",
"패키지명" => "com.nighttwo1.slackmsg",
},
default_payloads: [:git_branch, :git_author, :release_date],
footer: "테스트 후 피드백은 언제든지 환영합니다. 앱 사용 중 문제가 발생하거나 개선 사항이 있다면 메시지를 남겨주시면 감사하겠습니다.",
)
end
```### 2. Use customed block kit message
```ruby
lane :post_to_slack_with_custom_body do
slack_message(
webhook_url: "https://hooks.slack.com/services/...",
custom_body: '{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "새로운 안드로이드 앱이 배포되었습니다! 🚀",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "plain_text",
"text": "Checkout for new version of android app!",
"emoji": true
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*버전:* `0.1.10`"
},
{
"type": "mrkdwn",
"text": "*패키지명:* `com.nighttwo1.slackmsg`"
},
{
"type": "mrkdwn",
"text": "*Release Date:* `2024-06-05`"
}
]
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "테스트 후 피드백은 언제든지 환영합니다. 앱 사용 중 문제가 발생하거나 개선 사항이 있다면 메시지를 남겨주시면 감사하겠습니다."
}
}
]
}'
)
end
```# Parameters
| Key | Description | Environment Variable | Default | Type | Optional |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------- | ------------------------------ | ------ | -------- |
| `title` | The title displayed on the Slack message. | `FL_SLACK_MESSAGE_TITLE` | `새로운 메시지` | String | No |
| `sub_title` | The subtitle displayed on the Slack message. | `FL_SLACK_MESSAGE_SUB_TITLE` | | String | Yes |
| `webhook_url` | The Incoming WebHook URL for your Slack group. | `FL_SLACK_MESSAGE_WEBHOOK_URL` | | String | No |
| `payload` | A hash containing additional information to be displayed in the message. | `FL_SLACK_MESSAGE_PAYLOAD` | `{}` | Hash | No |
| `default_payloads` | An array containing default information to be displayed in the message. | `FL_SLACK_MESSAGE_DEFAULT_PAYLOADS` | `['git_branch', 'git_author']` | Array | No |
| `footer` | Additional message displayed at the bottom of the Slack message. | `FL_SLACK_MESSAGE_FOOTER` | | String | Yes |
| `custom_body` | A complete custom body for the Slack message in JSON format. If this is provided, it will override the other parameters. | `FL_SLACK_MESSAGE_CUSTOM_BODY` | | String | Yes |