class Fastlane::Actions::CreateGithubIssueAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb, line 27
def self.authors
  ["Ryo Sakaguchi"]
end
available_options() click to toggle source
# 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
description() click to toggle source
# File lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb, line 23
def self.description
  "Create GitHub issue"
end
details() click to toggle source
# 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) click to toggle source
# File lib/fastlane/plugin/create_github_issue/actions/create_github_issue_action.rb, line 80
def self.is_supported?(platform)
  true
end
return_value() click to toggle source
# 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) click to toggle source
# 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