diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 1223a2f4e60..9fee34fa8ee 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -293,9 +293,26 @@ platform :ios do def generate_build_number build_number = `curl -H "Accept: text/plain" -X POST -d '' "https://incrementator.appspot.com/api/v1/code/ORUHILeMbXB4D5Z5conFzYoYpQPjVnyUA4pu56X2MHVJSFxM/increment"` `echo BUILD_NUMBER=#{build_number} >> ./.post_build/.env` + write_extra_info_to_summary build_number end + def write_extra_info_to_summary + summary_file = ENV['GITHUB_STEP_SUMMARY'] + + if summary_file.nil? || summary_file.empty? + UI.error("GITHUB_STEP_SUMMARY is not set. Are you running in GitHub Actions?") + return + end + + File.open(summary_file, "a") do |file| + file.puts "## Fastlane Summary" + file.puts "- 🛠️ Version: '#{extra_info}'" + end + + UI.message("Successfully wrote to GITHUB_STEP_SUMMARY.") + end + # Fetch dependencies and prepare for building a release def prepare_for_release(options) xcode_version = options[:xcode_version]