check if wordpress is updating or publishing a post

I avoid the problem just checking if the ID of the post is already existing in the db.

get_post($id)==NULL

That’s probably the easiest way to do what I need.