Search code examples
continuous-integrationcontinuous-deploymentbitrise

Bitrise: How to add second "Git Clone Repository" step to a workflow?


I'm using Bitrise for CI/CD.

The Git Clone Repository build step uses the environment variable GIT_REPOSITORY_URL as an input to determine where to clone from.

I'd like to add a second step to clone another repository, but it seems like it is not possible to specify a different url to clone from.

If there is, can somebody tell me how to do that, or, alternatively, does anyone have an alternative approach?


Solution

  • I found a way that works for me: In our company project, Bitrise CI first runs the Activate SSH keystep, then the Git Clone Repository (which of course needs the first one for authentication) step from their library.

    Now when this is done, I still can't use another Git Clone Repository because of the limitation described in the question, but it's very easy to access another repository that uses the same credentials in a script. So that's what I did. My second repo is accessible with the same SSH key, so all I needed was a scriptbuild step that does this:

    git clone git@github.com:myrepo [my\desired\location]
    

    to get my second repo.