class Fastlane::Helper::GitlabChangelogHelper
Public Class Methods
get_depth(name, current_branch)
click to toggle source
# File lib/fastlane/plugin/gitlab_changelog/helper/gitlab_changelog_helper.rb, line 4 def self.get_depth(name, current_branch) current_branch.start_with?(name) ? 2 : 1 end
get_from_branch(name, current_branch)
click to toggle source
If the current branch is a branch we're comparing to (“release/..*” for example) - then pick depth = 2 to get a previous version number for the changelog. Otherwise - use the latest version as a reference branch.
# File lib/fastlane/plugin/gitlab_changelog/helper/gitlab_changelog_helper.rb, line 11 def self.get_from_branch(name, current_branch) depth = get_depth(name, current_branch) reference_branch = Action.sh("git ls-remote --sort='v:refname' --quiet --heads origin refs/heads/#{name}/* | tail -n #{depth} | head -n 1 | awk '{ printf \"%s\", $2 }' | rev | cut -d/ -f1 | rev | xargs echo -n") return "#{name}/#{reference_branch}" end