Class: Fastlane::Actions::GenerateReleaseChangelogAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::GenerateReleaseChangelogAction
- Defined in:
- lib/fastlane/plugin/changelog_generator/actions/generate_release_changelog_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .prompt_tag(message = '', excluded_tags = [], allow_none = false) ⇒ Object
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
45 46 47 |
# File 'lib/fastlane/plugin/changelog_generator/actions/generate_release_changelog_action.rb', line 45 def self. ["Fernando Saragoca"] end |
.available_options ⇒ Object
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 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/fastlane/plugin/changelog_generator/actions/generate_release_changelog_action.rb', line 53 def self. [ FastlaneCore::ConfigItem.new(key: :github_project, env_name: 'GENERATE_CHANGELOG_GITHUB_PROJECT', description: 'GitHub project name, including organization'), FastlaneCore::ConfigItem.new(key: :github_api_token, env_name: 'GENERATE_CHANGELOG_GITHUB_API_TOKEN', description: 'API token to access GitHub API', default_value: ENV["GITHUB_API_TOKEN"]), FastlaneCore::ConfigItem.new(key: :base_branch, env_name: 'GENERATE_CHANGELOG_BASE_BRANCH', description: 'Base branch for pull requests'), FastlaneCore::ConfigItem.new(key: :template, env_name: 'GENERATE_CHANGELOG_TEMPLATE', description: 'Template for generating changelog', optional: true), FastlaneCore::ConfigItem.new(key: :template_path, env_name: 'GENERATE_CHANGELOG_TEMPLATE_PATH', description: 'Contents of path will override `template` param', optional: true), FastlaneCore::ConfigItem.new(key: :tag_a, env_name: 'GENERATE_CHANGELOG_TAG_A', description: 'Tag to filter pull requests', optional: true), FastlaneCore::ConfigItem.new(key: :tag_b, env_name: 'GENERATE_CHANGELOG_TAG_B', description: 'Tag to filter pull requests', optional: true), FastlaneCore::ConfigItem.new(key: :skip_tag_b, env_name: 'GENERATE_CHANGELOG_SKIP_TAG_B', description: 'Skip second tag', is_string: false, optional: true), FastlaneCore::ConfigItem.new(key: :output_path, env_name: 'GENERATE_CHANGELOG_OUTPUT_PATH', description: 'If set, will automatically write changelog to output path', optional: true) ] end |
.description ⇒ Object
41 42 43 |
# File 'lib/fastlane/plugin/changelog_generator/actions/generate_release_changelog_action.rb', line 41 def self.description "Changelog generation based on merged pull requests & tags, filtered by one or two tags" end |
.is_supported?(platform) ⇒ Boolean
93 94 95 |
# File 'lib/fastlane/plugin/changelog_generator/actions/generate_release_changelog_action.rb', line 93 def self.is_supported?(platform) true end |
.prompt_tag(message = '', excluded_tags = [], allow_none = false) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fastlane/plugin/changelog_generator/actions/generate_release_changelog_action.rb', line 17 def self.prompt_tag( = '', = [], allow_none = false) no_tag_text = 'No tag' other_tag_text = 'Enter tag manually' tag_limit = 10 = Helper::ChangelogGeneratorHelper. .reject! { |tag| .include?(tag) } = .count = .take(tag_limit) << no_tag_text if allow_none << other_tag_text if > tag_limit if allow_none && .count == 1 UI.important("Skiping second tag because there are no tags available.") return nil end tag = UI.select(, ) tag = nil if tag == no_tag_text tag = UI.input('Tag: ') if tag == other_tag_text tag end |
.return_value ⇒ Object
49 50 51 |
# File 'lib/fastlane/plugin/changelog_generator/actions/generate_release_changelog_action.rb', line 49 def self.return_value "Generated changelog" end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/fastlane/plugin/changelog_generator/actions/generate_release_changelog_action.rb', line 4 def self.run(params) tag_a = params[:tag_a] || prompt_tag("Please enter first tag: ") tag_b = params[:tag_b] if tag_b.nil? && params[:skip_tag_b].nil? tag_b = prompt_tag("Please enter second tag: ", [tag_a], true) end labels, pull_requests = Helper::ChangelogGeneratorFetcher.fetch_github_data(params, lane_context) release = Helper::ChangelogGeneratorRelease.new(labels, pull_requests, tag_b, tag_a) Helper::ChangelogGeneratorRender.new([release], labels, params).to_markdown end |