fastlane-plugin-slack_bot 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03c0bf9287a10436d869bbac334c197e216fbddc6635edbe93029c0a1ffb2fa9
4
- data.tar.gz: ef070596a71b59a3bf42da3d56868df5c7cceb2f1f94526cd216c68f2f22b24c
3
+ metadata.gz: 20831e77ecd2bd1e1417a5e87175deb52e3c50dfb06b29620dbf0d709ff9f5f6
4
+ data.tar.gz: 05dac64d7c171616d1751a8118400e584297afc85ff76c92c90f3c0427f87885
5
5
  SHA512:
6
- metadata.gz: 16da8436f2649536e6807db16f8bd3f770e3cca86a285a3b29d29689b515dc1d51c4596e880d5feb1c2df7695ff295c33d3ece88e5d10035ab659023f48f9318
7
- data.tar.gz: 76d2056df21c4819bc824f1e1f5d7672c1f268fa8915dd5deec2d363bc04b438b371dd40ccbc3c05dcebf781bd51c210c1ac467e819874fc88c2492f8ff23ac9
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) 2020 Manish Rathi <m.rathi@catawiki.nl>
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 = { "Content-Type": "application/json", "Authorization": "Bearer #{options[:api_token]}" }
30
- payload = { channel: slack_channel, attachments: [slack_attachment] }
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",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module SlackBot
3
- VERSION = "0.2.1"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  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.2.1
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-01-04 00:00:00.000000000 Z
11
+ date: 2021-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry