Is there a way to create a link to the gitlab job that ran when outputting the result of a Fastlane Scan to Slack?
I want to have a link from within the Slack results to the gitlab job that ran.
Is there a way to create a link to the gitlab job that ran when outputting the result of a Fastlane Scan to Slack?
I want to have a link from within the Slack results to the gitlab job that ran.
The slack_message
argument supports Slack Flavoured Markdown, so you can pass a URL to it and it will link in Slack. So for example
slack_message: "QA UI Tests on iPhone 13 Pro"
should change to
slack_message: "<https://gitlab.com/link-to-job-that-you-provide|QA UI Tests on iPhone 13 Pro>"
And then that text will become a link to the job.
I was able to do this by adding the following to our gitlab-ci.yml file:
script:
- export JOB_ID=$CI_JOB_ID
And then in our fastlane file, I adjusted the slack_message field within the scan section:
slack_message: "CI Job: https://<urltogitlab>/" + ENV['JOB_ID'],