Description
Describe the enhancement
Being able to execute scripts/commands on hosted machine for cleanup (remove files, change permisions, whatever...) on Complete Job phase, for example before Cleaning up orphan processes
This could be configured using config flags like "context.Global.Variables" to allow this option or setup command/script to execute.
Additional information
For self-hosted runners if pipeline uses docker commands in all forms (containers, services, docker actions, docker run) that causes RW problems due creation of files with root ownership. Documented in other issues like #434
Solution of executing actions-runner as root also derivates on other problems. Ex: On nodejs some component like jest-runner can have problems using root privileges, that can causes that process "freezes" and job will end once we reach runner job time limit.
Other problems that we have with custom runners is that files are persisted between jobs if we don't do manual cleanups (checkout, rm step...). Being able to clean it at complete job could be nice.
On summary, if we are able to execute some bash script at end of job execution we can:
- remove files from previous jobs
- fix privilege permisions (toolscache, workdir, whatever)
Activity