Variable $GIT_REPOSITORY_URL empty when trying to use it in Slack message

Hello, I was trying to add Slack message to my application but I’ve encountered a problem - button with $GIT_REPOSITORY_URL doesn’t work. Probably $GIT_REPOSITORY_URL was empty.

notify-slack:
 steps:
  - slack@2.7.2:
      inputs:
        - webhook_url: $SLACK_WEBHOOK_URL
        - channel: "$SLACK_CHANNEL"
        - channel_on_error: "$SLACK_CHANNEL"
        - message: "$GIT_CLONE_COMMIT_MESSAGE_SUBJECT"
        - author_name: 'Build #$BITRISE_BUILD_NUMBER triggered by $GIT_CLONE_COMMIT_AUTHOR_NAME'
        - title: ''
        - fields: |-
            Branch|${BITRISE_GIT_BRANCH}
            Commit|${BITRISE_GIT_COMMIT}
            Workflow|${BITRISE_TRIGGERED_WORKFLOW_ID}
        - buttons: |-
            View on Bitrise|${BITRISE_BUILD_URL}
            View on GitHub|${GIT_REPOSITORY_URL}

Everything works perfectly except of this ‘View on GitHub’ button - it’s not showing up.

Hi @MichalTKwiecien,

Thanks for reporting!

The most likely explanation is that GIT_REPOSITORY_URL is the git clone URL, which might not be a browsable URL. E.g. it might be something like git@github.com:bitrise-io/bitrise.git

It’s the git clone URL you specify on the Settings tab of the app as the “REPOSITORY URL”.

Thanks for the response @viktorbenei . You are probably right because I’m using ssh instead of login/password authorisation. Since it’s not valid URL the button is not visible.

So now I think it’s a feature, not a bug :wink:

1 Like