fastlane-plugin-slack_bot 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/fastlane/plugin/slack_bot/actions/post_to_slack.rb +24 -2
- data/lib/fastlane/plugin/slack_bot/version.rb +1 -1
- metadata +2 -2
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
|
|
@@ -21,13 +21,23 @@ module Fastlane
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
slack_attachment = SlackAction.generate_slack_attachments(options)
|
|
24
|
+
bot_username = options[:username]
|
|
25
|
+
bot_icon_url = options[:icon_url]
|
|
24
26
|
|
|
25
27
|
begin
|
|
26
28
|
require 'excon'
|
|
27
29
|
|
|
28
30
|
api_url = "https://slack.com/api/chat.postMessage"
|
|
29
|
-
headers = {
|
|
30
|
-
|
|
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
|
+
}
|
|
31
41
|
payload[:thread_ts] = options[:thread_ts] unless options[:thread_ts].nil?
|
|
32
42
|
payload = payload.to_json
|
|
33
43
|
|
|
@@ -82,6 +92,18 @@ module Fastlane
|
|
|
82
92
|
env_name: "FL_POST_TO_SLACK_CHANNEL",
|
|
83
93
|
description: "#channel or @username",
|
|
84
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),
|
|
85
107
|
FastlaneCore::ConfigItem.new(key: :pretext,
|
|
86
108
|
env_name: "FL_POST_TO_SLACK_PRETEXT",
|
|
87
109
|
description: "This is optional text that appears above the message attachment block. This supports the standard Slack markup language",
|
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: 2021-
|
|
11
|
+
date: 2021-02-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pry
|