Class: Fastlane::Actions::CreateGithubIssueAction

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

Class Method Summary collapse

Class Method Details

.authorsObject



27
28
29
# File 'lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb', line 27

def self.authors
  ["Ryo Sakaguchi"]
end

.available_optionsObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb', line 40

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :api_token,
                                 env_name: '',
                                 description: "Your github token",
                                 optional: false,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :repo,
                                 env_name: '',
                                 description: 'Repository that you want to create an issue, format -> owner/name',
                                 optional: false,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :title,
                                 env_name: '',
                                 description: "Issue title",
                                 optional: false,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :body,
                                 env_name: '',
                                 description: 'Issue body',
                                 optional: true,
                                 type: String),
    FastlaneCore::ConfigItem.new(key: :labels,
                                 env_name: '',
                                 description: 'Issue labels',
                                 optional: true,
                                 type: Array),
    FastlaneCore::ConfigItem.new(key: :assignees,
                                 env_name: '',
                                 description: 'Issue assignees',
                                 optional: true,
                                 type: Array),
    FastlaneCore::ConfigItem.new(key: :milestone,
                                 env_name: '',
                                 description: 'Issue milestone',
                                 optional: true,
                                 type: String)
  ]
end

.descriptionObject



23
24
25
# File 'lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb', line 23

def self.description
  "Create GitHub issue"
end

.detailsObject



35
36
37
38
# File 'lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb', line 35

def self.details
  # Optional:
  "Create GitHub issue"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb', line 80

def self.is_supported?(platform)
  true
end

.return_valueObject



31
32
33
# File 'lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb', line 31

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
# File 'lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb', line 7

def self.run(params)
  other_action.github_api(
    server_url: "https://api.github.com",
    api_token: params[:api_token],
    http_method: 'POST',
    path: "/repos/#{params[:repo]}/issues",
    body: {
      title: params[:title],
      body: params[:body] || "",
      labels: params[:labels] || [],
      assignees: params[:assignees] || [],
      milestone: params[:milestone]
    }
  )
end