Postgresql container unhealthy status running first time

Lately, I’ve been facing this issue a lot, when the action runs for the first time, it is unable to check the postgres container health status and then the pipeline fails.

After, re-running the pipeline it works perfectly fine.