Run a script before "Fetching changes..."

I’m using the script executor. Part of my build process uses a docker container which leaves some files behind owned as root. The next build will fail because it can not clean up those files.

before_script runs too late

I’ve added an after_script to change the file ownership but that will not run if the build is canceled while it is running.

Thanks,
allen