Also test that release tasks are invoked the correct environment. Closes #3817
Note: this won't compile as the triggers themselves aren't implemented just yet.