@@ -41,7 +41,7 @@ class GitHubPublisher:
4141 - Common GitHub automation steps (fork, clone, branch, file commit, pull request)
4242 """
4343
44- def __init__ (self ):
44+ def __init__ (self , repo_name : str = OSC_REPO_NAME ):
4545 with fsspec .open (".gitaccess" , "r" ) as file :
4646 git_config = yaml .safe_load (file ) or {}
4747 self .github_username = git_config .get ("github-username" )
@@ -50,7 +50,10 @@ def __init__(self):
5050 raise ValueError ("GitHub credentials are missing in the `.gitaccess` file." )
5151
5252 self .github_automation = GitHubAutomation (
53- self .github_username , self .github_token , OSC_REPO_OWNER , OSC_REPO_NAME
53+ self .github_username ,
54+ self .github_token ,
55+ OSC_REPO_OWNER ,
56+ repo_name
5457 )
5558 self .github_automation .fork_repository ()
5659 self .github_automation .clone_sync_repository ()
@@ -102,9 +105,23 @@ class Publisher:
102105 """Publishes products (datasets) to the OSC GitHub repository.
103106 """
104107
105- def __init__ (self , dataset_config_path : str , workflow_config_path : str ):
108+ def __init__ (
109+ self ,
110+ dataset_config_path : str ,
111+ workflow_config_path : str ,
112+ environment : str = "production" ,
113+ ):
114+ self .environment = environment
115+ # Determine repo name based on environment
116+ repo_name = "open-science-catalog-metadata"
117+
118+ if environment == "staging" :
119+ repo_name = "open-science-catalog-metadata-staging"
120+ elif environment == "testing" :
121+ repo_name = "open-science-catalog-metadata-testing"
122+
106123 # Composition
107- self .gh_publisher = GitHubPublisher ()
124+ self .gh_publisher = GitHubPublisher (repo_name = repo_name )
108125 self .collection_id = ""
109126 self .workflow_title = ""
110127
0 commit comments