class Fastlane::Actions::EnsureUnreleasedChangelogAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/unreleased_changelog/actions/ensure_unreleased_changelog.rb, line 62
def self.authors
  ["crazymanish"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/unreleased_changelog/actions/ensure_unreleased_changelog.rb, line 46
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :file_name,
                                 env_name: "FL_ENSURE_UNRELEASED_CHANGELOG_FILE_NAME",
                                 description: "The YML file name to your release changelog, (default: 'changelog')",
                                 is_string: true,
                                 default_value: "changelog"),
    FastlaneCore::ConfigItem.new(key: :show_diff,
                                 env_name: "FL_ENSURE_UNRELEASED_CHANGELOG_SHOW_DIFF",
                                 description: "The flag whether to show the unreleased changelog if found",
                                 optional: true,
                                 default_value: true,
                                 is_string: false)
  ]
end
description() click to toggle source
# File lib/fastlane/plugin/unreleased_changelog/actions/ensure_unreleased_changelog.rb, line 42
def self.description
  "Raises an exception if there are no unreleased release notes changelog"
end
example_code() click to toggle source
# File lib/fastlane/plugin/unreleased_changelog/actions/ensure_unreleased_changelog.rb, line 66
def self.example_code
  [
    'ensure_unreleased_changelog',
    'ensure_unreleased_changelog(file_name: "changelog_file_name")'
  ]
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/unreleased_changelog/actions/ensure_unreleased_changelog.rb, line 73
def self.is_supported?(platform)
  true
end
print_unreleased(changelog, type) click to toggle source
run(params) click to toggle source
# File lib/fastlane/plugin/unreleased_changelog/actions/ensure_unreleased_changelog.rb, line 7
def self.run(params)
  # reading unreleased changelog
  unreleased_changelog = GetUnreleasedChangelogAction.run(file_name: params[:file_name])

  # checking unreleased changelog
  is_empty_unreleased_changelog = true
  changelog_types = Helper::UnreleasedChangelogHelper.changelog_types
  changelog_types.each do |changelog_type|
    is_empty_unreleased_changelog = false unless unreleased_changelog[changelog_type].nil?

    # printing unreleased changelog, if needed.
    if params[:show_diff]
      self.print_unreleased(unreleased_changelog, changelog_type)
    end
  end

  UI.user_error!("No unreleased changelog found 🔥🛑") if is_empty_unreleased_changelog
end