added `when` condition to publish plugins