Does this help?
add_action( \'save_post_product\', \'sew_chg_status\', 10,2 );
function sew_chg_status( $post_id, $post ){
$product = new WC_Product( $post_id ); //create a WC product with post data
if ( 0 < $_POST[\'_stock\'] ){ // if data sent about stock by WC is strictly superior to 0
$product->set_status( \'publish\' ); // change the product status
}
}