Extract logic for when CI jobs execute.