How can I control if post updated

add below action in your main function file of your plugin

add_action( 'wp_insert_post', 'my_project_updated_post', 10, 3 );

function my_project_updated_post( $post_id, $post, $update ) {
  // your code goes here
  // Every time you will get updated or newly created post id here.
}