According to https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&viewFallbackFrom=vsts&tabs=schema#checkout we can have this:
steps:
- checkout: self
clean: true
But as far as I understand the documentation it only cleans the source tree, not all the build directories.
Workspace clean is probably what you want. You can define a workspace schema under the job and choose the resources to clean up.
Check here for more information about workspace.
- job: myJob
workspace:
clean: outputs | resources | all # what to clean up before the job runs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With