# How to make drone downstream plugin emit \`custom\` event instead of \`push\`

**URL:** <https://drone.discourse.group/t/how-to-make-drone-downstream-plugin-emit-custom-event-instead-of-push/11267>\
**Category:** Drone Support\
**Created:** [October 30, 2020, 9:19pm UTC](https://drone.discourse.group/t/how-to-make-drone-downstream-plugin-emit-custom-event-instead-of-push/11267 "2020-10-30T21:19:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zanona](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/zanona/32/2624_2.png) [@zanona](https://drone.discourse.group/u/zanona)\
**Post date:** [October 30, 2020, 9:19pm UTC](https://drone.discourse.group/t/how-to-make-drone-downstream-plugin-emit-custom-event-instead-of-push/11267/1 "2020-10-30T21:19:09Z")

</div>

I have a downstream step after a npm package publish which will trigger linked repositories and my intent was to, within the downstream triggered build, update the npm package `MODULE_NAME` and then commit again to the parent repository, which would then trigger a second build on the child repository, with the updated dependency.

The problem is that the downstream plugin is dispatched with the `push` event, so it’s really like any other build for the linked repository. I was expecting the downstream plugin to trigger the `custom` event, so I could have a separate pipeline only for dealing with those updates.

How would you advise achieving this behaviour without transforming the main pipeline into conditional maze, checking environment variables provided by the plugin?

thanks in advance

```auto
# main pipeline

steps
  - install
  - build
  - test
  - deploy

trigger:
  event: {exclude: [tag, custom]}

---

# downstream pipeline

steps:
  - 'npm update $MODULE_NAME'
  - git commit -m "build: update $MODULE_NAME dependency"
  - git push origin "$DRONE_BRANCH"

trigger:
   event: [custom]

```

---

<div class="post-metadata">

**Author:** ![zanona](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/zanona/32/2624_2.png) [@zanona](https://drone.discourse.group/u/zanona)\
**Post date:** [October 31, 2020, 8:54am UTC](https://drone.discourse.group/t/how-to-make-drone-downstream-plugin-emit-custom-event-instead-of-push/11267/2 "2020-10-31T08:54:21Z")

</div>

Just an update on my previous question.  
I believe for simulating something that behaves on a similar fashion, [deployments](http://plugins.drone.io/drone-plugins/drone-downstream/#trigger-deployment) would work as expected. So:

```diff
  - name: downstream
    image: plugins/downstream
    settings:
      ...
      fork: true
+ deploy: upstream
+ last_successful: true
      repositories:
        - ...

```

And then, on the downstream repository I could enable a pipeline that activates on `upstream` targets only.

```diff
kind: pipeline
name: default

steps:
  ...

trigger:
- event: {exclude: [tag, custom]}
+ event: {exclude: [tag]}
+ target: { exclude: [upstream] }

---

kind: pipeline
type: docker
name: self-update

steps:
  - npm install ${MODULE_NAME}
  - git commit -am "build: update $MODULE_NAME dependency"

trigger:
- event: [custom]
+ target: [upstream]

```
