Skip to content

Instantly share code, notes, and snippets.

@litoarias
Created October 13, 2021 12:11
Show Gist options
  • Save litoarias/bdf166d2d06b9df9ea9cb1a7226f8c6a to your computer and use it in GitHub Desktop.
Save litoarias/bdf166d2d06b9df9ea9cb1a7226f8c6a to your computer and use it in GitHub Desktop.
Slack manager for Fastlane
def broadcast_message()
version = get_info_plist_value(
path: "#{APP_NAME}/Info.plist",
key: "CFBundleShortVersionString"
)
build = get_info_plist_value(
path: "#{APP_NAME}/Info.plist",
key: "CFBundleVersion"
)
slack(
message: "Hi! A new iOS build has been submitted to TestFlight",
payload: {
"Build Date" => Time.new.to_s,
"Release Version" => version+"."+build
},
slack_url: SLACK_CHANNEL,
use_webhook_configured_username_and_icon: true,
fail_on_error: false,
success: true
)
end
def on_error(exception)
slack(
message: exception.to_s,
slack_url: SLACK_CHANNEL,
success: false,
payload: { "Output" => exception.to_s },
fail_on_error: true
)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment