Class: Fastlane::Actions::NotiDingdingAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::NotiDingdingAction
- Defined in:
- lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb
Overview
钉钉通知
Class Method Summary collapse
- .available_options ⇒ Object
- .category ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .run(params) ⇒ Object
Class Method Details
.available_options ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb', line 30 def self. [ FastlaneCore::ConfigItem.new( key: :notiText, description: "要发送的钉钉通知内容", optional: false, # 是否可选 type: String ), ] end |
.category ⇒ Object
45 46 47 |
# File 'lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb', line 45 def self.category :notifications end |
.description ⇒ Object
26 27 28 |
# File 'lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb', line 26 def self.description "钉钉通知" end |
.is_supported?(platform) ⇒ Boolean
41 42 43 |
# File 'lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb', line 41 def self.is_supported?(platform) platform == :ios end |
.run(params) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb', line 8 def self.run(params) UI.("*************| 开始钉钉消息通知 |*************") notiText = params[:notiText] || "" curl = %Q{ curl 'https://oapi.dingtalk.com/robot/send?access_token=#{Environment.dingdingToken}' \ -H 'Content-Type:application/json' \ -d '{ "msgtype":"markdown", "markdown":{ "title":"#{Environment.scheme} 打包通知", "text":"#{notiText}" } }' } system curl end |