1

Is there a way to create a link to the gitlab job that ran when outputting the result of a Fastlane Scan to Slack?

enter image description here

enter image description here

I want to have a link from within the Slack results to the gitlab job that ran.

reutsey
  • 1,743
  • 1
  • 17
  • 36

2 Answers2

1

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.

Colm Doyle
  • 3,598
  • 1
  • 20
  • 22
0

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'],
reutsey
  • 1,743
  • 1
  • 17
  • 36