jhurtas
jhurtas

Reputation: 694

Disable source code checkout in specific pipeline stages

I have a pipeline with multiple stages, and the source code is checked out automatically on all of them. I do not need the source code, but only published artifacts.

How can disable source code checkout for specific stages?

Upvotes: 37

Views: 27742

Answers (1)

Shamrai Aleksander
Shamrai Aleksander

Reputation: 16133

Use Checkout option: https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#checkout

Example:

trigger:
- main

pool:
  vmImage: 'ubuntu-latest'

jobs:
- job: no_checkout
  steps:
  - checkout: none

  - script: echo Hello, world!
    displayName: 'Run a one-line script'

- job: checkout
  steps:
  - script: echo Hello, world!
    displayName: 'Run a one-line script'

Upvotes: 72

Related Questions