fastlane-plugin-slack_bot 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +50 -5
- data/lib/fastlane/plugin/slack_bot/actions/fetch_files_slack.rb +81 -0
- data/lib/fastlane/plugin/slack_bot/actions/post_to_slack.rb +59 -7
- data/lib/fastlane/plugin/slack_bot/actions/update_slack_message.rb +149 -0
- data/lib/fastlane/plugin/slack_bot/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20831e77ecd2bd1e1417a5e87175deb52e3c50dfb06b29620dbf0d709ff9f5f6
|
4
|
+
data.tar.gz: 05dac64d7c171616d1751a8118400e584297afc85ff76c92c90f3c0427f87885
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d07cf960466cdaa41f6a6a36bcb88cc25bb8befd531f519948c6a2416e72f7809d100b0c0706fbac4e1501b4b7f0fa9eb5156c3c8c06dc553d193450ca689902
|
7
|
+
data.tar.gz: 84bfcbf72612922233b819899443c64b9fbd00fda7decaec4f49e1a40c0bec695c3785efe797acda0f29261cfd10de008e5488cdbe5877597229d1ec0dde9279
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2021 Manish Rathi
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
## Fastlane `slack_bot` plugin
|
2
2
|
|
3
|
-
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-slack_bot)
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-slack_bot) ![![License]](https://img.shields.io/badge/license-MIT-green.svg?style=flat) [![Gem Version](https://badge.fury.io/rb/fastlane-plugin-slack_bot.svg)](https://badge.fury.io/rb/fastlane-plugin-slack_bot) ![![RubyGem Download Badge]](https://ruby-gem-downloads-badge.herokuapp.com/fastlane-plugin-slack_bot?type=total) [![Twitter: @manish](https://img.shields.io/badge/contact-@manish-blue.svg?style=flat)](https://twitter.com/manish_rathi_)
|
4
4
|
|
5
5
|
## About slack_bot
|
6
6
|
|
7
|
-
A fastlane plugin to post slack message using bot api token.
|
8
|
-
Note: `Fastlane` comes with `slack` plugin by default, which uses slack webhook url, which can't send direct message & other limitations.
|
7
|
+
A fastlane plugin to post slack message using bot api token. 🚀\
|
8
|
+
Note: `Fastlane` comes with `slack` plugin by default, which uses slack webhook url, which can't send direct message & other webhook limitations.
|
9
9
|
|
10
10
|
## Getting Started
|
11
11
|
|
12
|
-
1. Generate `Slack token` for `Fastlane` bot
|
12
|
+
1. [Generate `Slack token` for `Fastlane` bot](https://slack.com/intl/en-nl/help/articles/115005265703-Create-a-bot-for-your-workspace)
|
13
13
|
- From your Slack organization page, go to `Manage` -> `Custom Integrations`
|
14
14
|
- Open `Bots`
|
15
15
|
- Add Configuration
|
@@ -28,6 +28,25 @@ bundle exec fastlane add_plugin slack_bot
|
|
28
28
|
|
29
29
|
3. Add `slack_bot` to your lane in `Fastfile` whenever you want to post a slack message
|
30
30
|
|
31
|
+
## Examples
|
32
|
+
|
33
|
+
In the following example lets send a message to the default slack bot channel.
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
# share on Slack
|
37
|
+
post_to_slack(message: "App successfully released!")
|
38
|
+
```
|
39
|
+
|
40
|
+
In the following example lets send a direct message to a slack user that unit tests CI has been failed.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
# share on Slack
|
44
|
+
post_to_slack(
|
45
|
+
message: "CI: Your unit tests on #{ENV['CI_COMMIT_REF_NAME']} failed",
|
46
|
+
channel: "@SlackUsername" # This can be Slack userID, instead of username i.e @UXXXXX
|
47
|
+
)
|
48
|
+
```
|
49
|
+
|
31
50
|
In the following example lets send slack message to `#ios-team` channel for test-flight build.
|
32
51
|
|
33
52
|
```ruby
|
@@ -41,13 +60,39 @@ lane :beta do
|
|
41
60
|
|
42
61
|
# share on Slack
|
43
62
|
post_to_slack(
|
44
|
-
api_token: "xyz", # Preferably configure as ENV['SLACK_API_TOKEN']
|
45
63
|
message: "Hi team, we have a new test-flight beta build: #{beta_release_name}",
|
46
64
|
channel: "#ios-team"
|
47
65
|
)
|
48
66
|
end
|
49
67
|
```
|
50
68
|
|
69
|
+
In the following example lets send slack message with custom payload.
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
# share on Slack
|
73
|
+
post_to_slack(
|
74
|
+
api_token: "xyz", # Preferably configure as ENV['SLACK_API_TOKEN']
|
75
|
+
message: "App successfully released!",
|
76
|
+
channel: "#channel", # Optional, by default will post to the default channel configured for the Slack Bot.
|
77
|
+
success: true, # Optional, defaults to true.
|
78
|
+
payload: { # Optional, lets you specify any number of your own Slack attachments.
|
79
|
+
"Build Date" => Time.new.to_s,
|
80
|
+
"Built by" => "Jenkins",
|
81
|
+
},
|
82
|
+
default_payloads: [:git_branch, :git_author], # Optional, lets you specify an allowlist of default payloads to include. Pass an empty array to suppress all the default payloads.
|
83
|
+
# Don't add this key, or pass nil, if you want all the default payloads. The available default payloads are: `lane`, `test_result`, `git_branch`, `git_author`, `last_git_commit`, `last_git_commit_hash`.
|
84
|
+
attachment_properties: { # Optional, lets you specify any other properties available for attachments in the slack API (see https://api.slack.com/docs/attachments).
|
85
|
+
# This hash is deep merged with the existing properties set using the other properties above. This allows your own fields properties to be appended to the existing fields that were created using the `payload` property for instance.
|
86
|
+
thumb_url: "http://example.com/path/to/thumb.png",
|
87
|
+
fields: [{
|
88
|
+
title: "My Field",
|
89
|
+
value: "My Value",
|
90
|
+
short: true
|
91
|
+
}]
|
92
|
+
}
|
93
|
+
)
|
94
|
+
```
|
95
|
+
|
51
96
|
## Issues and Feedback
|
52
97
|
|
53
98
|
For any other issues and feedback about this plugin, please submit it to this repository.
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/slack_bot_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
module SharedValues
|
7
|
+
FETCH_FILES_SLACK_RESULT = :FETCH_FILES_SLACK_RESULT
|
8
|
+
end
|
9
|
+
class FetchFilesSlackAction < Action
|
10
|
+
def self.run(options)
|
11
|
+
require 'excon'
|
12
|
+
require 'json'
|
13
|
+
|
14
|
+
api_url = "https://slack.com/api/files.list"
|
15
|
+
headers = { "Content-Type": "application/json", "Authorization": "Bearer #{options[:api_token]}" }
|
16
|
+
query = { channel: options[:channel], count: options[:count], page: options[:page] }
|
17
|
+
|
18
|
+
response = Excon.get(api_url, headers: headers, query: query)
|
19
|
+
status_code = response[:status]
|
20
|
+
UI.user_error!("Response body is nil, status code: #{status_code} 💥") if response.body.nil?
|
21
|
+
|
22
|
+
result = {
|
23
|
+
status: status_code,
|
24
|
+
body: response.body,
|
25
|
+
json: JSON.parse(response.body)
|
26
|
+
}
|
27
|
+
|
28
|
+
Actions.lane_context[SharedValues::FETCH_FILES_SLACK_RESULT] = result
|
29
|
+
return result
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.description
|
33
|
+
"List files of any #channel using Slack bot `files.list` api."
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.available_options
|
37
|
+
[
|
38
|
+
FastlaneCore::ConfigItem.new(key: :api_token,
|
39
|
+
env_name: "FL_FETCH_FILES_SLACK_BOT_TOKEN",
|
40
|
+
description: "Slack bot Token",
|
41
|
+
sensitive: true,
|
42
|
+
code_gen_sensitive: true,
|
43
|
+
is_string: true,
|
44
|
+
default_value: ENV["SLACK_API_TOKEN"],
|
45
|
+
default_value_dynamic: true,
|
46
|
+
optional: false),
|
47
|
+
FastlaneCore::ConfigItem.new(key: :channel,
|
48
|
+
env_name: "FL_FETCH_FILES_SLACK_CHANNEL",
|
49
|
+
description: "slack #channel ID",
|
50
|
+
optional: false),
|
51
|
+
FastlaneCore::ConfigItem.new(key: :count,
|
52
|
+
env_name: "FL_FETCH_FILES_SLACK_COUNT",
|
53
|
+
description: "Number of items to return per page, default value: 100",
|
54
|
+
default_value: "100",
|
55
|
+
optional: true),
|
56
|
+
FastlaneCore::ConfigItem.new(key: :page,
|
57
|
+
env_name: "FL_FETCH_FILES_SLACK_PAGE",
|
58
|
+
description: "Page number of results to return, default value: 1",
|
59
|
+
default_value: "1",
|
60
|
+
optional: true)
|
61
|
+
]
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.authors
|
65
|
+
["crazymanish"]
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.example_code
|
69
|
+
[
|
70
|
+
'fetch_files_slack(channel: "CHXYMXXXX")',
|
71
|
+
'fetch_files_slack(channel: "CHXYMXXXX", count: "10")',
|
72
|
+
'fetch_files_slack(channel: "CHXYMXXXX", count: "10", page: "2")'
|
73
|
+
]
|
74
|
+
end
|
75
|
+
|
76
|
+
def self.is_supported?(platform)
|
77
|
+
true
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -3,37 +3,72 @@ require_relative '../helper/slack_bot_helper'
|
|
3
3
|
|
4
4
|
module Fastlane
|
5
5
|
module Actions
|
6
|
+
module SharedValues
|
7
|
+
POST_TO_SLACK_RESULT = :POST_TO_SLACK_RESULT
|
8
|
+
end
|
9
|
+
|
6
10
|
class PostToSlackAction < Action
|
7
|
-
def self.run(
|
11
|
+
def self.run(options)
|
8
12
|
require 'slack-notifier'
|
9
13
|
|
10
14
|
options[:message] = (options[:message].to_s || '').gsub('\n', "\n")
|
11
15
|
options[:message] = Slack::Notifier::Util::LinkFormatter.format(options[:message])
|
12
|
-
|
13
16
|
options[:pretext] = options[:pretext].gsub('\n', "\n") unless options[:pretext].nil?
|
14
17
|
|
15
18
|
if options[:channel].to_s.length > 0
|
16
19
|
slack_channel = options[:channel]
|
17
|
-
slack_channel = ('#' + options[:channel]) unless ['#', '@'].include?(slack_channel[0]) #
|
20
|
+
slack_channel = ('#' + options[:channel]) unless ['#', 'C', '@'].include?(slack_channel[0]) # Add prefix(#) by default, if needed
|
18
21
|
end
|
19
22
|
|
20
23
|
slack_attachment = SlackAction.generate_slack_attachments(options)
|
24
|
+
bot_username = options[:username]
|
25
|
+
bot_icon_url = options[:icon_url]
|
21
26
|
|
22
27
|
begin
|
23
28
|
require 'excon'
|
24
29
|
|
25
30
|
api_url = "https://slack.com/api/chat.postMessage"
|
26
|
-
headers = {
|
27
|
-
|
31
|
+
headers = {
|
32
|
+
"Content-Type": "application/json; charset=utf-8",
|
33
|
+
"Authorization": "Bearer #{options[:api_token]}"
|
34
|
+
}
|
35
|
+
payload = {
|
36
|
+
channel: slack_channel,
|
37
|
+
username: bot_username,
|
38
|
+
icon_url: bot_icon_url,
|
39
|
+
attachments: [slack_attachment]
|
40
|
+
}
|
41
|
+
payload[:thread_ts] = options[:thread_ts] unless options[:thread_ts].nil?
|
42
|
+
payload = payload.to_json
|
28
43
|
|
29
|
-
Excon.post(api_url, headers: headers, body: payload)
|
44
|
+
response = Excon.post(api_url, headers: headers, body: payload)
|
45
|
+
result = self.formatted_result(response)
|
30
46
|
rescue => exception
|
31
47
|
UI.error("Exception: #{exception}")
|
48
|
+
return nil
|
32
49
|
else
|
33
50
|
UI.success("Successfully sent Slack notification")
|
51
|
+
Actions.lane_context[SharedValues::POST_TO_SLACK_RESULT] = result
|
52
|
+
return result
|
34
53
|
end
|
35
54
|
end
|
36
55
|
|
56
|
+
def self.formatted_result(response)
|
57
|
+
result = {
|
58
|
+
status: response[:status],
|
59
|
+
body: response.body || "",
|
60
|
+
json: self.parse_json(response.body) || {}
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.parse_json(value)
|
65
|
+
require 'json'
|
66
|
+
|
67
|
+
JSON.parse(value)
|
68
|
+
rescue JSON::ParserError
|
69
|
+
nil
|
70
|
+
end
|
71
|
+
|
37
72
|
def self.description
|
38
73
|
"Post a slack message"
|
39
74
|
end
|
@@ -57,6 +92,18 @@ module Fastlane
|
|
57
92
|
env_name: "FL_POST_TO_SLACK_CHANNEL",
|
58
93
|
description: "#channel or @username",
|
59
94
|
optional: true),
|
95
|
+
FastlaneCore::ConfigItem.new(key: :username,
|
96
|
+
env_name: "FL_SLACK_USERNAME",
|
97
|
+
description: "Overrides the bot's username (chat:write.customize scope required)",
|
98
|
+
default_value: "fastlane",
|
99
|
+
is_string: true,
|
100
|
+
optional: true),
|
101
|
+
FastlaneCore::ConfigItem.new(key: :icon_url,
|
102
|
+
env_name: "FL_SLACK_ICON_URL",
|
103
|
+
description: "Overrides the bot's image (chat:write.customize scope required)",
|
104
|
+
default_value: "https://fastlane.tools/assets/img/fastlane_icon.png",
|
105
|
+
is_string: true,
|
106
|
+
optional: true),
|
60
107
|
FastlaneCore::ConfigItem.new(key: :pretext,
|
61
108
|
env_name: "FL_POST_TO_SLACK_PRETEXT",
|
62
109
|
description: "This is optional text that appears above the message attachment block. This supports the standard Slack markup language",
|
@@ -74,6 +121,7 @@ module Fastlane
|
|
74
121
|
env_name: "FL_POST_TO_SLACK_DEFAULT_PAYLOADS",
|
75
122
|
description: "Remove some of the default payloads. More information about the available payloads on GitHub",
|
76
123
|
optional: true,
|
124
|
+
default_value: ['lane', 'test_result', 'git_branch', 'git_author', 'last_git_commit', 'last_git_commit_hash'],
|
77
125
|
type: Array),
|
78
126
|
FastlaneCore::ConfigItem.new(key: :attachment_properties,
|
79
127
|
env_name: "FL_POST_TO_SLACK_ATTACHMENT_PROPERTIES",
|
@@ -85,7 +133,11 @@ module Fastlane
|
|
85
133
|
description: "Was this successful? (true/false)",
|
86
134
|
optional: true,
|
87
135
|
default_value: true,
|
88
|
-
is_string: false)
|
136
|
+
is_string: false),
|
137
|
+
FastlaneCore::ConfigItem.new(key: :thread_ts,
|
138
|
+
env_name: "FL_POST_TO_SLACK_THREAD_TS",
|
139
|
+
description: "Provide another message's ts value to make this message a reply",
|
140
|
+
optional: true)
|
89
141
|
]
|
90
142
|
end
|
91
143
|
|
@@ -0,0 +1,149 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/slack_bot_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
module SharedValues
|
7
|
+
UPDATE_SLACK_MESSAGE_RESULT = :UPDATE_SLACK_MESSAGE_RESULT
|
8
|
+
end
|
9
|
+
class UpdateSlackMessageAction < Action
|
10
|
+
def self.run(options)
|
11
|
+
require 'slack-notifier'
|
12
|
+
|
13
|
+
options[:message] = (options[:message].to_s || '').gsub('\n', "\n")
|
14
|
+
options[:message] = Slack::Notifier::Util::LinkFormatter.format(options[:message])
|
15
|
+
options[:pretext] = options[:pretext].gsub('\n', "\n") unless options[:pretext].nil?
|
16
|
+
slack_attachment = SlackAction.generate_slack_attachments(options)
|
17
|
+
|
18
|
+
begin
|
19
|
+
require 'excon'
|
20
|
+
|
21
|
+
api_url = "https://slack.com/api/chat.update"
|
22
|
+
headers = { "Content-Type": "application/json", "Authorization": "Bearer #{options[:api_token]}" }
|
23
|
+
payload = { channel: options[:channel], attachments: [slack_attachment], ts: options[:ts] }.to_json
|
24
|
+
|
25
|
+
response = Excon.post(api_url, headers: headers, body: payload)
|
26
|
+
result = self.formatted_result(response)
|
27
|
+
rescue => exception
|
28
|
+
UI.error("Exception: #{exception}")
|
29
|
+
return nil
|
30
|
+
else
|
31
|
+
UI.success("Successfully updated the Slack message")
|
32
|
+
Actions.lane_context[SharedValues::UPDATE_SLACK_MESSAGE_RESULT] = result
|
33
|
+
return result
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.formatted_result(response)
|
38
|
+
result = {
|
39
|
+
status: response[:status],
|
40
|
+
body: response.body || "",
|
41
|
+
json: self.parse_json(response.body) || {}
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.parse_json(value)
|
46
|
+
require 'json'
|
47
|
+
|
48
|
+
JSON.parse(value)
|
49
|
+
rescue JSON::ParserError
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.description
|
54
|
+
"Update a slack message using time-stamp(ts) value"
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.available_options
|
58
|
+
[
|
59
|
+
FastlaneCore::ConfigItem.new(key: :api_token,
|
60
|
+
env_name: "FL_UPDATE_SLACK_MESSAGE_BOT_TOKEN",
|
61
|
+
description: "Slack bot Token",
|
62
|
+
sensitive: true,
|
63
|
+
code_gen_sensitive: true,
|
64
|
+
is_string: true,
|
65
|
+
default_value: ENV["SLACK_API_TOKEN"],
|
66
|
+
default_value_dynamic: true,
|
67
|
+
optional: false),
|
68
|
+
FastlaneCore::ConfigItem.new(key: :ts,
|
69
|
+
env_name: "FL_UPDATE_SLACK_MESSAGE_TS",
|
70
|
+
description: "Timestamp of the message to be updated",
|
71
|
+
optional: false),
|
72
|
+
FastlaneCore::ConfigItem.new(key: :channel,
|
73
|
+
env_name: "FL_UPDATE_SLACK_MESSAGE_CHANNEL",
|
74
|
+
description: "Slack channel i.e C1234567890",
|
75
|
+
optional: false),
|
76
|
+
FastlaneCore::ConfigItem.new(key: :pretext,
|
77
|
+
env_name: "FL_UPDATE_SLACK_MESSAGE_PRETEXT",
|
78
|
+
description: "This is optional text that appears above the message attachment block. This supports the standard Slack markup language",
|
79
|
+
optional: true),
|
80
|
+
FastlaneCore::ConfigItem.new(key: :message,
|
81
|
+
env_name: "FL_UPDATE_SLACK_MESSAGE_MESSAGE",
|
82
|
+
description: "The message that should be displayed on Slack",
|
83
|
+
optional: true),
|
84
|
+
FastlaneCore::ConfigItem.new(key: :payload,
|
85
|
+
env_name: "FL_UPDATE_SLACK_MESSAGE_PAYLOAD",
|
86
|
+
description: "Add additional information to this post. payload must be a hash containing any key with any value",
|
87
|
+
default_value: {},
|
88
|
+
is_string: false),
|
89
|
+
FastlaneCore::ConfigItem.new(key: :default_payloads,
|
90
|
+
env_name: "FL_UPDATE_SLACK_MESSAGE_DEFAULT_PAYLOADS",
|
91
|
+
description: "Remove some of the default payloads. More information about the available payloads on GitHub",
|
92
|
+
optional: true,
|
93
|
+
default_value: ['lane', 'test_result', 'git_branch', 'git_author', 'last_git_commit', 'last_git_commit_hash'],
|
94
|
+
type: Array),
|
95
|
+
FastlaneCore::ConfigItem.new(key: :attachment_properties,
|
96
|
+
env_name: "FL_UPDATE_SLACK_MESSAGE_ATTACHMENT_PROPERTIES",
|
97
|
+
description: "Merge additional properties in the slack attachment, see https://api.slack.com/docs/attachments",
|
98
|
+
default_value: {},
|
99
|
+
is_string: false),
|
100
|
+
FastlaneCore::ConfigItem.new(key: :success,
|
101
|
+
env_name: "FL_UPDATE_SLACK_MESSAGE_SUCCESS",
|
102
|
+
description: "Was this successful? (true/false)",
|
103
|
+
optional: true,
|
104
|
+
default_value: true,
|
105
|
+
is_string: false)
|
106
|
+
]
|
107
|
+
end
|
108
|
+
|
109
|
+
def self.authors
|
110
|
+
["crazymanish"]
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.example_code
|
114
|
+
[
|
115
|
+
'update_slack_message(
|
116
|
+
ts: "1609711037.000100",
|
117
|
+
channel: "C1234567890",
|
118
|
+
message: "Update: App successfully released!"
|
119
|
+
)',
|
120
|
+
'update_slack_message(
|
121
|
+
ts: "1609711037.000100",
|
122
|
+
channel: "C1234567890",
|
123
|
+
message: "Update: App successfully released!",
|
124
|
+
success: true, # Optional, defaults to true.
|
125
|
+
payload: { # Optional, lets you specify any number of your own Slack attachments.
|
126
|
+
"Build Date" => Time.new.to_s,
|
127
|
+
"Built by" => "Jenkins",
|
128
|
+
},
|
129
|
+
default_payloads: [:git_branch, :git_author], # Optional, lets you specify a whitelist of default payloads to include. Pass an empty array to suppress all the default payloads.
|
130
|
+
# Don\'t add this key, or pass nil, if you want all the default payloads. The available default payloads are: `lane`, `test_result`, `git_branch`, `git_author`, `last_git_commit`, `last_git_commit_hash`.
|
131
|
+
attachment_properties: { # Optional, lets you specify any other properties available for attachments in the slack API (see https://api.slack.com/docs/attachments).
|
132
|
+
# This hash is deep merged with the existing properties set using the other properties above. This allows your own fields properties to be appended to the existing fields that were created using the `payload` property for instance.
|
133
|
+
thumb_url: "http://example.com/path/to/thumb.png",
|
134
|
+
fields: [{
|
135
|
+
title: "My Field",
|
136
|
+
value: "My Value",
|
137
|
+
short: true
|
138
|
+
}]
|
139
|
+
}
|
140
|
+
)'
|
141
|
+
]
|
142
|
+
end
|
143
|
+
|
144
|
+
def self.is_supported?(platform)
|
145
|
+
true
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-slack_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manish Rathi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -145,7 +145,9 @@ files:
|
|
145
145
|
- LICENSE
|
146
146
|
- README.md
|
147
147
|
- lib/fastlane/plugin/slack_bot.rb
|
148
|
+
- lib/fastlane/plugin/slack_bot/actions/fetch_files_slack.rb
|
148
149
|
- lib/fastlane/plugin/slack_bot/actions/post_to_slack.rb
|
150
|
+
- lib/fastlane/plugin/slack_bot/actions/update_slack_message.rb
|
149
151
|
- lib/fastlane/plugin/slack_bot/helper/slack_bot_helper.rb
|
150
152
|
- lib/fastlane/plugin/slack_bot/version.rb
|
151
153
|
homepage: https://github.com/crazymanish/fastlane-plugin-slack_bot
|
@@ -167,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
169
|
- !ruby/object:Gem::Version
|
168
170
|
version: '0'
|
169
171
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
172
|
+
rubygems_version: 3.1.4
|
171
173
|
signing_key:
|
172
174
|
specification_version: 4
|
173
175
|
summary: "A fastlane plugin to post slack message using bot api token. \U0001F680"
|