Azure Devops - is there way to do a taskkill BEFORE checkout

Viewed 375

I've noticed the yaml doesn't have an explicit checkout step, and we have a failure with some files that are locked by a hung testhost process.

I am able to add the following

  - task: CmdLine@2
    inputs:
      script: 'wmic process where name="testhost.exe" call terminate'
    condition: always()

to then end of a pipeline run.

Wondering if there is a way to make it run BEFORE the git checkout. The checkout isn't part of the YAML.

1 Answers

Adding - checkout: self after the script will do the trick.

 [...]
 steps:
   - task: CmdLine@2
     inputs:
       script: 'wmic process where name="testhost.exe" call terminate'
     condition: always()
   - checkout: self
 [...]
Related