Why not just make them parameters if you are going to put them upfront and turn them into ENVs?
How do you deal with a commit that needs to be rerun? What if the flags have changed in between?