Skip to content

Commit 91fb50c

Browse files
authored
[notify] Allow CI_COMMIT_BRANCH to not exist (#33925)
1 parent 834167f commit 91fb50c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks/notify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def check_consistent_failures(ctx, pipeline_id, job_failures_file="job_execution
9090
# The jobs dictionary contains the consecutive and cumulative failures for each job
9191
# The consecutive failures are reset to 0 when the job is not failing, and are raising an alert when reaching the CONSECUTIVE_THRESHOLD (3)
9292
# The cumulative failures list contains 1 for failures, 0 for succes. They contain only then CUMULATIVE_LENGTH(10) last executions and raise alert when 50% failure rate is reached
93-
if not should_notify(pipeline_id) or os.environ['CI_COMMIT_BRANCH'] != os.environ['CI_DEFAULT_BRANCH']:
93+
if not should_notify(pipeline_id) or os.environ.get('CI_COMMIT_BRANCH') != os.environ['CI_DEFAULT_BRANCH']:
9494
print("Consistent failures check is only run on the not-downstream default branch")
9595
return
9696

0 commit comments

Comments
 (0)