Class: Fastlane::Actions::NotiDingdingAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb

Overview

钉钉通知

Class Method Summary collapse

Class Method Details

.available_optionsObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb', line 30

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :notiText,
      description: "要发送的钉钉通知内容",
      optional: false, # 是否可选
      type: String
    ),
  ]
end

.categoryObject



45
46
47
# File 'lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb', line 45

def self.category
  :notifications
end

.descriptionObject



26
27
28
# File 'lib/fastlane/plugin/fastci/actions/noti_dingding_action.rb', line 26

def self.description
  "钉钉通知"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (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.message("*************| 开始钉钉消息通知 |*************")
  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