Class: Fastlane::Actions::DingTalkMsgMdPushAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::DingTalkMsgMdPushAction
- Defined in:
- lib/fastlane/plugin/ding_talk_msg_push/actions/ding_talk_msg_md_push_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
41 42 43 |
# File 'lib/fastlane/plugin/ding_talk_msg_push/actions/ding_talk_msg_md_push_action.rb', line 41 def self. ["lingyou"] end |
.available_options ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/fastlane/plugin/ding_talk_msg_push/actions/ding_talk_msg_md_push_action.rb', line 54 def self. [ FastlaneCore::ConfigItem.new(key: :title, env_name: "DING_TALK_MSG_PUSH_TITLE", description: "the dingtalk msg title", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :token, env_name: "DING_TALK_MSG_PUSH_TOKEN", description: "the dingtalk robot token", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :text, env_name: "DING_TALK_MSG_PUSH_TEXT", description: "the content text send", optional: false, type: String), FastlaneCore::ConfigItem.new(key: :at_all, env_name: "DING_TALK_MSG_PUSH_AT_ALL", description: "at all user", is_string: false, default_value: false) ] end |
.description ⇒ Object
37 38 39 |
# File 'lib/fastlane/plugin/ding_talk_msg_push/actions/ding_talk_msg_md_push_action.rb', line 37 def self.description "dingTalk robot msg push tool" end |
.details ⇒ Object
49 50 51 52 |
# File 'lib/fastlane/plugin/ding_talk_msg_push/actions/ding_talk_msg_md_push_action.rb', line 49 def self.details # Optional: "钉钉推送工具" end |
.is_supported?(platform) ⇒ Boolean
79 80 81 82 83 84 85 |
# File 'lib/fastlane/plugin/ding_talk_msg_push/actions/ding_talk_msg_md_push_action.rb', line 79 def self.is_supported?(platform) # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example) # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform # # [:ios, :mac, :android].include?(platform) true end |
.return_value ⇒ Object
45 46 47 |
# File 'lib/fastlane/plugin/ding_talk_msg_push/actions/ding_talk_msg_md_push_action.rb', line 45 def self.return_value # If your method provides a return value, you can describe here what it does end |
.run(params) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fastlane/plugin/ding_talk_msg_push/actions/ding_talk_msg_md_push_action.rb', line 7 def self.run(params) UI.("The ding_talk_msg_push plugin is working!") # UI.message(params.to_json) title = params[:title] || '' token = params[:token] text = params[:text] at_all = params[:at_all] == nil ? false : params[:at_all] curl = %Q{ curl 'https://oapi.dingtalk.com/robot/send?access_token=#{token}' \ -H 'Content-Type: application/json' \ -d ' { "msgtype": "markdown", "markdown": { "title": "#{title}", "text": "#{text}" }, "at": { "isAtAll": #{at_all} } }' } UI.(curl) system curl end |