warns that
we should not boast about an achievement or celebrate a success before it has actually been accomplished.
same as
Cross the bridge when you come to it
Imagine a case where do not worry about a possible future problem, you will deal with it when and if it happens.; then “Never cackle till your egg is laid” fits well.