Class: Fastlane::Actions::CreateOrUpdateConfluencePageAction

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

Overview

Generate release notes based on git changelog

Class Method Summary collapse

Class Method Details

.authorsObject



27
28
29
# File 'lib/fastlane/plugin/apadmi_grout/actions/create_or_update_confluence_page_action.rb', line 27

def self.authors
  ["samdc@apadmi.com"]
end

.available_optionsObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fastlane/plugin/apadmi_grout/actions/create_or_update_confluence_page_action.rb', line 31

def self.available_options
  Apadmi::Grout::CommonOptions.confluence_options + [
    FastlaneCore::ConfigItem.new(key: :page_title,
                                 description: "Title of the file being created/updated",
                                 type: String,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :parent_page_id,
                                 description: "The ID of page's direct parent",
                                 type: String,
                                 optional: false),
    FastlaneCore::ConfigItem.new(key: :action,
                                 description: "Block that is called with the current page contents if it exists. Should return the new page contents",
                                 optional: false,
                                 type: :string_callback)
  ]
end

.descriptionObject



23
24
25
# File 'lib/fastlane/plugin/apadmi_grout/actions/create_or_update_confluence_page_action.rb', line 23

def self.description
  "Create or update a confluence page with a given title"
end

.is_supported?(_platform) ⇒ Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/fastlane/plugin/apadmi_grout/actions/create_or_update_confluence_page_action.rb', line 48

def self.is_supported?(_platform)
  true
end

.run(params) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/plugin/apadmi_grout/actions/create_or_update_confluence_page_action.rb', line 12

def self.run(params)
  logger = FastLane::FastlaneLogger.new

  confluence_service = Apadmi::Grout::DIWrapper.confluence_service(params)
  action = Apadmi::Grout::CreateOrUpdateConfluencePageAction.new(confluence_service, logger)

  action.run(params[:page_title], params[:parent_page_id]) do |current_content|
    params[:action].call(current_content)
  end
end