Apoorva Desai

02/28/2022, 10:09 PM
Hello, I am trying to run a prefect flow triggered by when there is a change in a github repository that is NOT the repo that the prefect flow lives in. TLDR: pull request on repository A triggers prefect flow living in Repository B. This is the closest I've come to figuring this out: Has anyone done this before or have instructions?

Kevin Kho

02/28/2022, 10:11 PM
Hi @Apoorva Desai, our paradigm around this is triggering the Flow like this. You can hit the Prefect API with
or the
Or you can even use a Python request

Anna Geller

02/28/2022, 10:25 PM
could you explain the problem that you try to solve a bit more? if you would like to just execute code from another repository, you could use pygit2:
@task(name="Clone DBT repo")
def pull_dbt_repo(repo_url: str, branch: str = None):
    pygit2.clone_repository(url=repo_url, path=DBT_PROJECT, checkout_branch=branch)
but if you are trying to build a CI/CD pipeline, you would usually register a flow on merge to e.g. master branch rather than triggering a flow

Apoorva Desai

03/01/2022, 8:56 AM
Thank you!
👍 1