Skip to content

Commit

Permalink
improve error-handling (be nicer to end-user)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccwienk committed Dec 16, 2024
1 parent 90c7d09 commit 18919dc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/gardener_ci/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ def _pipeline_definitions(
'''
parses pipeline-definitions from .ci/pipeline_definitions from current repo's work-tree
'''
with open(os.path.join(repo.working_tree_dir, '.ci', 'pipeline_definitions')) as f:
if not os.path.exists(pipeline_definitions_path := os.path.join(
repo.working_tree_dir, '.ci', 'pipeline_definitions'
)):
logger.error(f'Error: did not find pipeline-definitions at {pipeline_definitions_path}')
logger.info('hint: pass --repo')
exit(1)

with open(pipeline_definitions_path) as f:
raw = yaml.safe_load(f)

if not branch_cfg:
Expand Down

0 comments on commit 18919dc

Please sign in to comment.