Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changelog from git commits path option #12429

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 19 additions & 11 deletions fastlane/lib/fastlane/actions/changelog_from_git_commits.rb
Expand Up @@ -29,19 +29,22 @@ def self.run(params)
merge_commit_filtering = :exclude_merges
end

if params[:commits_count]
changelog = Actions.git_log_last_commits(params[:pretty], params[:commits_count], merge_commit_filtering, params[:date_format], params[:ancestry_path])
else
changelog = Actions.git_log_between(params[:pretty], from, to, merge_commit_filtering, params[:date_format], params[:ancestry_path])
end
changelog = changelog.gsub("\n\n", "\n") if changelog # as there are duplicate newlines
Actions.lane_context[SharedValues::FL_CHANGELOG] = changelog
Dir.chdir(params[:path]) do
if params[:commits_count]
changelog = Actions.git_log_last_commits(params[:pretty], params[:commits_count], merge_commit_filtering, params[:date_format], params[:ancestry_path])
else
changelog = Actions.git_log_between(params[:pretty], from, to, merge_commit_filtering, params[:date_format], params[:ancestry_path])
end

changelog = changelog.gsub("\n\n", "\n") if changelog # as there are duplicate newlines
Actions.lane_context[SharedValues::FL_CHANGELOG] = changelog

puts("")
puts(changelog)
puts("")
puts("")
puts(changelog)
puts("")

changelog
changelog
end
end

#####################################################
Expand Down Expand Up @@ -83,6 +86,11 @@ def self.available_options
verify_block: proc do |value|
UI.user_error!(":commits_count must be >= 1") unless value.to_i >= 1
end),
FastlaneCore::ConfigItem.new(key: :path,
env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_PATH',
description: 'Path of the git repository',
optional: true,
default_value: './'),
FastlaneCore::ConfigItem.new(key: :pretty,
env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_PRETTY',
description: 'The format applied to each commit while generating the collected value',
Expand Down