Passing a variable to a Pipe that was set within the script

Viewed 457

Pipes used within a Pipeline can accept parameters, the values can be environmental variables that are configured within Bitbucket (repo or deployment settings).

But if a variable is set within the Script section, that variable is not available when passing the value to the Pipe.

Is there any way to work around this?

script:
- export MY_MESSAGE = "Hello world"
- pipe: atlassian/slack-notify:0.2.1
  variables:
    WEBHOOK_URL: $WEBHOOK_URL
    MESSAGE: $MY_MESSAGE

In that example, the value of $MY_MESSAGE is not passed to the MESSAGE parameter of atlassian/slack-notify because it would need to be set within Bitbucket itself.

0 Answers
Related