I need to "return" value from fastlane script to config.yml (this question is not about how to pass parameters from config.yml to fastlane script, the question is about returning back the data from fastlane to config.yml) and save it in $ENV dictionary (propably).
This is a part of config.yml where I want to send a slack notification if the build is successfully sent to Testflight
# .circleci/config.yml
build_steps:
steps:
- restore_cache: *restore_git_cache
- checkout
- save_cache: *save_git_cache
- restore_cache: *restore_gem_cache
- run: *bundle_install
- save_cache: *save_gem_cache
- run: *pod_install
- run: bundle install
- run:
name: Fastlane
command: bundle exec fastlane $FASTLANE_LANE
- store_artifacts:
path: output
destination: output
- slack/notify:
event: pass
channel: $SLACK_DEFAULT_CHANNEL
custom: '<slack_template >$BUILD_NUMBER_FROM_FASTLANE_SCRIPT_THAT_I_NEED'</slack_template>
This is a part of fastlane/Fastfile file
# fastlane/Fastfile
desc "My App Upload to Testflight"
lane :upload_testflight do | options |
api_key = app_store_connect_api_key()
build_number = latest_testflight_build_number(
api_key: api_key,
app_identifier: "my.app.dev.com"
)
increment_build_number({
build_number: build_number + 1 // THIS VALUE I NEED IN MY .circleci/config.yml for slack notification
})