Build runAction function