Environment variable for git URL from GitHub webhook (in addition to the existing GIT_REPOSITORY_URL one)

The existing GIT_REPOSITORY_URL env var is set to the repository URL you have on the Settings tab.

I would like the git URL from a GitHub webhook to be available as an environment variable.

Use case:

I want to have a single Bitrise “app” + Workflow that is used to build many iOS frameworks. The only thing missing to make this work is for the git URL associated with the webhook to be available as an environment variable (and ideally the repo slug and org/user, but those could be parsed from the URL if needed).

Basically I want to connect different git repositories to the same bitrise.io app, instead of registering the separate repositories as separate bitrise.io apps.

Hi @bwhiteley, thanks for the #feature-request!

I understand why this would come in handy for you, I’m interested in seeing how many of our users would benefit from this :slightly_smiling_face:

The following are set from GitHub web hooks:
BITRISE_GIT_BRANCH
BITRISE_GIT_COMMIT
BITRISE_GIT_MESSAGE

Tag events also include
BITRISE_GIT_TAG

Pull request events also include
BITRISEIO_GIT_BRANCH_DEST
BITRISEIO_PULL_REQUEST_REPOSITORY_URL

Pull request events actually have everything we need since they include the BITRISEIO_PULL_REQUEST_REPOSITORY_URL (which might not be universally true in the case of forked repos).

We’re just asking for one more env var for all push and PR events: the repo URL.
It looks like the “url” property would do the trick.
https://developer.github.com/v3/activity/events/types/#pushevent
You could call it “BITRISE_GIT_WEBHOOK_REPOSITORY_URL”
to distinguish it from the existing “GIT_REPOSITORY_URL” (which comes from app settings).

See also: