Skip the clone step

Hi,

I wonder how I can skip the clone step when it’s the only one in the pipeline.

For example, I set up the pipeline as below:

pipeline:
  step1:
    image: golang
    when:
      event: [ push ]
      branch: [ test ]

When I push to branch test1, it also triggers a build with only one step clone.

If I override the clone step as below:

clone:
  clone:
    image: plugins/git
    when:
      event: [ push ]
      branch: [ test ]
pipeline:
  step1:
    image: golang
    when:
      event: [ push ]
      branch: [ test ]

When I push to branch test1, the GUI shows one build is pending forever.

I use drone 0.8

1 Like

Bump. How do you do this in Drone 0.8.x?

you can add a no-op clone step like this:

clone:
  none:
    image: alpine
    commands:
    - echo skipping clone

pipeline: ...

Hi,
Just tried this method. As expected repo wasn’t cloned and echo command executed. What I am trying to implement is to completely omit this item from build list for this repo. Is it possible in current drone. I am using 0.8 verion.

Another question about your method. Will it skip cloning for all branches and all pipeline steps?

Join to nikolaevigor answer. bradrydzewski, is it possible to completely omit clone step in this case?

Hi Brad,
Please, could you advise, what is the correct way to filter the clone step execution on 1.x version? Currently clone is step is being executed even when we have not request it to…

https://docs.drone.io/pipeline/docker/syntax/cloning/#custom-logic