# Condition with Repo is not working

**URL:** <https://drone.discourse.group/t/condition-with-repo-is-not-working/5118>\
**Category:** Drone Support\
**Created:** [December 19, 2020, 10:09pm UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118 "2020-12-19T22:09:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yasmine\_Marzouk](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/yasmine_marzouk/32/3119_2.png) [@Yasmine\_Marzouk](https://drone.discourse.group/u/Yasmine_Marzouk)\
**Post date:** [December 19, 2020, 10:09pm UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118/1 "2020-12-19T22:09:26Z")

</div>

Hi guys,  
I need your support, I’m using downstream plugin to trigger build from other repo, (both are implemented with Drone CI), I’m trying filtering the step I want to call by repo (the name of repo B which triggers Repo A) but this is not working

---

<div class="post-metadata">

**Author:** ![ashwilliams1](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/ashwilliams1/32/5549_2.png) [@ashwilliams1](https://drone.discourse.group/u/ashwilliams1)\
**Post date:** [December 20, 2020, 12:26am UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118/2 "2020-12-20T00:26:10Z")

</div>

> I’m trying filtering the step I want to call by repo (the name of repo B which triggers Repo A) but this is not working

this is not how the repo condition works.

the main use case for the repository condition is when you fork a repository and you have Drone enabled for the repository and its fork. You may (for example) want to skip certain steps if the repository is a fork. For this, you would use the repo condition.

```plaintext
kind: pipeline
type: docker
name: default

steps:
- name: build
  image: golang
  commands:
  - go build
  when:
    repo:
    - ashwilliams1/drone # only run this step for my fork

- name: deploy
  image: plugins/docker
  settings: ...
  when:
    repo:
    - drone/drone # only run this step for the main repo

```

---

<div class="post-metadata">

**Author:** ![Yasmine\_Marzouk](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/yasmine_marzouk/32/3119_2.png) [@Yasmine\_Marzouk](https://drone.discourse.group/u/Yasmine_Marzouk)\
**Post date:** [December 20, 2020, 5:47pm UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118/3 "2020-12-20T17:47:05Z")

</div>

Yes, I did this for this purpose but not working.  
Thanks a lot for your support.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [December 20, 2020, 6:05pm UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118/4 "2020-12-20T18:05:16Z")

</div>

here is a sample yaml to demonstrate:

> <https://github.com/drone/hello-world/blob/c81f4ce86b38203373eb75a0e6e5a281b723439f/.drone.yml>

and here is the resulting build: [https://cloud.drone.io/drone/hello-world/214/1/2](https://cloud.drone.io/drone/hello-world/214/1/2)

The above yaml and resulting pipeline demonstrate how the feature works as expected. The first step (test1) does not execute because the repository for which the pipeline is executing does not match the when condition. The second step (test2) executes because the repository for which the pipeline is executing _does_ match the repository in the when condition.

---

<div class="post-metadata">

**Author:** ![Yasmine\_Marzouk](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/yasmine_marzouk/32/3119_2.png) [@Yasmine\_Marzouk](https://drone.discourse.group/u/Yasmine_Marzouk)\
**Post date:** [December 20, 2020, 6:28pm UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118/5 "2020-12-20T18:28:07Z")

</div>

Can I trigger specific pipeline from downstream, If I have two pipelines, so that one pipeline has only the stage I want to execute from the other repo?

---

<div class="post-metadata">

**Author:** ![Yasmine\_Marzouk](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/yasmine_marzouk/32/3119_2.png) [@Yasmine\_Marzouk](https://drone.discourse.group/u/Yasmine_Marzouk)\
**Post date:** [December 20, 2020, 6:31pm UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118/6 "2020-12-20T18:31:19Z")

</div>

@bradrydzewski how to use the params in repo, to add condition in the other repo:  
for example I use this  
params:  
- BE=true  
and I want to add condition in the other repo, If BE=false skip this step

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [December 20, 2020, 6:31pm UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118/7 "2020-12-20T18:31:34Z")

</div>

> [@Drone\_validate\_plugin\_endpoint](https://drone.discourse.group/t/drone-validate-plugin-endpoint/8522/5):
>
> Can I trigger specific pipeline from downstream, If I have two pipelines, so that one pipeline has only the stage I want to execute from the other repo?

no, this capability does not exist.

---

<div class="post-metadata">

**Author:** ![Yasmine\_Marzouk](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/yasmine_marzouk/32/3119_2.png) [@Yasmine\_Marzouk](https://drone.discourse.group/u/Yasmine_Marzouk)\
**Post date:** [December 20, 2020, 6:33pm UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118/8 "2020-12-20T18:33:07Z")

</div>

I use if $BE=false exit 78 but this exists all the remaining steps, if there other code to exit only one step?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [December 20, 2020, 6:54pm UTC](https://drone.discourse.group/t/condition-with-repo-is-not-working/5118/9 "2020-12-20T18:54:31Z")

</div>

you can use `exit 0` to exit the step without failing and without skipping remaining steps.
