in lib/release_tools/public_release/release.rb [178:227]
def commit_version_files(
branch,
versions,
message: 'Update VERSION files',
project: project_path,
skip_ci: false,
skip_merge_train: false
)
actions = versions.each_with_object([]) do |(file, version), memo|
action =
begin
if client.file_contents(project, file, branch).strip != version.strip
'update'
end
rescue Gitlab::Error::NotFound
'create'
end
next unless action
logger.info(
"Setting version file #{file} to #{version.tr("\n", ' ')}",
project: project,
action: action,
file: file,
version: version,
branch: branch
)
memo << { action: action, file_path: file, content: version }
end
return if actions.empty?
tags = []
tags << '[ci skip]' if skip_ci
tags << '[merge-train skip]' if skip_merge_train
message += "\n\n#{tags.join("\n")}" if tags.any?
client.create_commit(project, branch, message, actions)
end