Is it possible to run commands with the webhook plugin?


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:

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

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

or you can create a custom plugin from a bash script:

1 Like