8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'fastlane/lib/fastlane/actions/make_changelog_from_jenkins.rb', line 8
def self.run(params)
require 'json'
require 'net/http'
changelog = ""
if Helper.ci? || Helper.test?
jenkins_api_url = URI(ENV["BUILD_URL"] + "api/json\?wrapper\=changes\&xpath\=//changeSet//comment")
begin
json = JSON.parse(Net::HTTP.get(jenkins_api_url))
json['changeSet']['items'].each do |item|
= params[:include_commit_body] ? item['comment'] : item['msg']
changelog << .strip + "\n"
end
rescue => ex
UI.error("Unable to read/parse changelog from jenkins: #{ex.message}")
end
end
Actions.lane_context[SharedValues::FL_CHANGELOG] = changelog.strip.length > 0 ? changelog : params[:fallback_changelog]
end
|