Is there anyway that we can set the SQL server in a way that when the Database size is growth and the disk is full, the SQL server will automatically shink the DB growthing ?
you have to monitor the db growth, and act accordingly to the reason of the db growing.
if it's just the transaction log file, the issue could be that transaction log backups are not in place, or a replication not working.
if it's the data files, you might need to either ensure more disk space in time, or delete/move data, or ....
https://www.experts-exchange.com/questions/20465860/automatically-shrink-the-log-file.html?anchorAnswerId=7777626#a7777626
~Raj