Not sure if I'm missing something small or what, b...
# prefect-community
j
Not sure if I'm missing something small or what, but I am getting a FileNotFoundError when using Git Store for my flows. From what I can see, the temporary directory is being deleted before the flow can actually be extracted. I replicated it with the below code. Anyone know what I'm doing wrong?
Copy code
clone_url = "XXXXXXX"

with TemporaryGitRepo(clone_url) as temp_repo:
    flow = extract_flow_from_file(
        file_path=os.path.join(
            temp_repo.temp_dir.name,
            "path/to/flow/fil.py",
        ),
        flow_name="flow_name",
    )
r
Hello 🙂 not sure which Prefect version you are using but you can try to setup a github_storage variable:
Copy code
gh_storage = GitHub(
    repo="your-organization/your-project",
    path="your/path/to-your-flow/your_flow.py",
    ref="master"
)
.....
with Flow(
    'your_flow',
    storage=gh_storage,
    ....
) as flow:
.....
The GitHub access token can be provided by your environment variables. I am not from Prefect but I use it a lot 😄
🙌 1