Use lambdas and pack expansion to reduce template instantiations in action_dispatch

2 jobs for improved-action-dispatch in 193 minutes and 16 seconds (queued for 5 seconds)
Status Name Job ID Coverage
  Test
passed job_clang_amd64 #4834
amd64

03:13:14

passed job_gcc_amd64 #4833
amd64

02:30:42