File tree Expand file tree Collapse file tree 2 files changed +15
-14
lines changed Expand file tree Collapse file tree 2 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ def _initial_providers():
3030 yield
3131
3232
33-
3433def pytest_configure (config ):
3534 # push sentry to ci
3635 os .environ ["RUNTIME__SENTRY_DSN" ] = "https://6f6f7b6f8e0f458a89be4187603b55fe@o1061158.ingest.sentry.io/4504819859914752"
Original file line number Diff line number Diff line change @@ -225,19 +225,21 @@ def skip_if_not_active(destination: str) -> None:
225225
226226
227227def is_running_in_github_fork () -> bool :
228- event_path = os .environ ["GITHUB_EVENT_PATH" ]
229-
230- # Extract necessary information from the GitHub Actions event payload
231- with open (event_path , encoding = "utf-8" ) as f :
232- event_data = dlt .common .json .load (f )
233-
234- # Check if the pull request is from a fork
235- is_pull_request_from_fork = (
236- event_data .get ("pull_request" , {})
237- .get ("head" , {})
238- .get ("repo" , {})
239- .get ("fork" , False )
240- )
228+ event_path = os .environ .get ("GITHUB_EVENT_PATH" )
229+ is_pull_request_from_fork = False
230+
231+ if event_path :
232+ # Extract necessary information from the GitHub Actions event payload
233+ with open (event_path , encoding = "utf-8" ) as f :
234+ event_data = dlt .common .json .load (f )
235+
236+ # Check if the pull request is from a fork
237+ is_pull_request_from_fork = (
238+ event_data .get ("pull_request" , {})
239+ .get ("head" , {})
240+ .get ("repo" , {})
241+ .get ("fork" , False )
242+ )
241243
242244 return is_pull_request_from_fork
243245
You can’t perform that action at this time.
0 commit comments