Is it possible to run commands with the webhook plugin?

Greetings!

As the title says, I am seeking to run commands such as source, echo, etc. from within my step that uses the image: plugins/webhook. The purpose of this is to use data stored in a temporary file from within the workspace (stored in a previous step since there’s no env var persistence) to populate a message to Microsoft Teams.

Thanks in advance!

It is not possible to run commands inside a plugin, however, you always have the option to script curl commands or even to create your own plugin that suits your exact use case. For example, instead of a plugin you could do this:

steps:
- name: write-file
  image: alpine
  commands:
  - echo "hello world" > file.txt

- name: send-file
  image: some-image-with-curl
  commands:
  - curl -X POST -d @file.txt https://....

or you can create a custom plugin from a bash script:
https://docs.drone.io/plugins/bash/

1 Like