class Fastlane::Actions::CommitChangelogAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/mobile_common/actions/commit_changelog.rb, line 39
def self.authors
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
  ["SemenovAlexander"]
end
available_options() click to toggle source
# File lib/fastlane/plugin/mobile_common/actions/commit_changelog.rb, line 28
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :app_suffix,
                                 env_name: "FL_COMMIT_CHANGELOG_APP_SUFFIX", # The name of the environment variable
                                 description: "Suffix, added to changelog filenames, used to split changelogs for different app flavors in same repository", # a short description of this parameter
                                 is_string: true,
                                 default_value: "",
                                 optional: true)
  ]
end
description() click to toggle source

@!group Documentation

# File lib/fastlane/plugin/mobile_common/actions/commit_changelog.rb, line 24
def self.description
  "Commits changelog changes to git, which were made by 'update_changelog' action"
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/mobile_common/actions/commit_changelog.rb, line 44
def self.is_supported?(platform)
  true
end
run(params) click to toggle source
# File lib/fastlane/plugin/mobile_common/actions/commit_changelog.rb, line 7
def self.run(params)
  # fastlane will take care of reading in the parameter and fetching the environment variable:
  app_suffix = params[:app_suffix]
  changelog_filename_suffix = "_#{app_suffix}" unless app_suffix.to_s == ''

  #               ensure we have not staged anything except changelog
  sh("git reset HEAD")
  #               adding changed files, we need to add uplevel because this code is executed inside 'fastlane' folder
  sh("git add CHANGELOG#{changelog_filename_suffix}.md")
  sh("git add CHANGELOG_CURRENT#{changelog_filename_suffix}.md")
  sh("git commit -m \"Changelog update #{app_suffix}\"")
end