File size: 614 Bytes
b5768dd
 
 
2eba038
 
 
 
b5768dd
2eba038
b5768dd
 
2eba038
b91fe62
2eba038
 
b5768dd
2eba038
b5768dd
b91fe62
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from git import Repo
import os

# Retrieve the environment variables
GITHUB_PAT = os.getenv('GITHUB_PAT')
GIT_id = os.getenv('GIT_id')
GIT_repo = os.getenv('GIT_repo')

if GITHUB_PAT:
    print("GITHUB_PAT set")

# Ensure the cloned_repo directory does not already exist
if not os.path.exists('cloned_repo'):  
    # Clone the repository using the Personal Access Token for authentication
    Repo.clone_from(f'https://{GIT_id}:{GITHUB_PAT}@github.com/{GIT_id}/{GIT_repo}.git', './cloned_repo')

# Import the main module from the cloned repository
import cloned_repo.main as main
from cloned_repo.main import *