@@ -27,8 +27,9 @@ def setup_env(
2727 profiles_yml : Optional [str ],
2828 bigquery_keyfile : Optional [str ],
2929 gcs_keyfile : Optional [str ],
30+ snowflake_keyfile : Optional [str ],
3031):
31- logging .info (f "Setting up the environment." )
32+ logging .info ("Setting up the environment." )
3233 dbt_dir = Path .home () / ".dbt"
3334 dbt_dir .mkdir (parents = True , exist_ok = True )
3435 if profiles_yml :
@@ -37,6 +38,8 @@ def setup_env(
3738 Path ("/tmp/bigquery_keyfile.json" ).write_text (bigquery_keyfile )
3839 if gcs_keyfile :
3940 Path ("/tmp/gcs_keyfile.json" ).write_text (gcs_keyfile )
41+ if snowflake_keyfile :
42+ Path ("/tmp/snowflake_keyfile.key" ).write_text (snowflake_keyfile )
4043
4144
4245def install_edr (
@@ -108,7 +111,7 @@ def install_edr(
108111
109112
110113def run_edr (edr_command : str , project_dir : Optional [str ]):
111- logging .info (f "Running the edr command." )
114+ logging .info ("Running the edr command." )
112115 subprocess .run (edr_command , shell = True , check = True , cwd = project_dir )
113116
114117
@@ -119,6 +122,7 @@ class Args(BaseModel):
119122 profiles_yml : Optional [str ]
120123 edr_command : str
121124 bigquery_keyfile : Optional [str ]
125+ snowflake_keyfile : Optional [str ]
122126 gcs_keyfile : Optional [str ]
123127 profile_target : Optional [str ]
124128
@@ -131,16 +135,22 @@ def main():
131135 profile_target = os .getenv ("INPUT_PROFILE-TARGET" ) or None ,
132136 project_dir = os .getenv ("INPUT_PROJECT-DIR" ) or None ,
133137 bigquery_keyfile = os .getenv ("INPUT_BIGQUERY-KEYFILE" ) or None ,
138+ snowflake_keyfile = os .getenv ("INPUT_SNOWFLAKE-KEYFILE" ) or None ,
134139 gcs_keyfile = os .getenv ("INPUT_GCS-KEYFILE" ) or None ,
135140 adapter_version = os .getenv ("INPUT_ADAPTER-VERSION" ) or None ,
136141 )
137142 install_dbt (args .adapter , args .adapter_version )
138- setup_env (args .profiles_yml , args .bigquery_keyfile , args .gcs_keyfile )
143+ setup_env (
144+ args .profiles_yml ,
145+ args .bigquery_keyfile ,
146+ args .gcs_keyfile ,
147+ args .snowflake_keyfile ,
148+ )
139149 install_edr (args .adapter , args .project_dir , args .profile_target )
140150 try :
141151 run_edr (args .edr_command , args .project_dir )
142152 except subprocess .CalledProcessError :
143- logging .exception (f "Failed to run the edr command." )
153+ logging .exception ("Failed to run the edr command." )
144154 raise
145155
146156
0 commit comments