Fix check on whether action should run.