Feature spotlight: Passing parameters between actions

Feature spotlight: Passing parameters between actions

The 'Pass arguments' action in Buddy lets you ask about parameters during pipeline execution. The parameters are available in consecutive actions as environment variables. This way you can change the behavior of a pipeline while an execution is in progress.

Parameters can be used in many different cases, such as building scripts or trigger conditions. For example, you can ask at the beginning of the execution whether to send a notification about a new version.

Since we released the action last year it grew very popular and many a time we get amazed how people are using it. With today's release we gave it some lifting and added some very interesting options, such as setting the default value.

Configuring 'Pass arguments' action

Let's assume we have a simple pipeline which tests and deploys the application, and notifies our clients via Slack.

Image loading...Pipeline example

Let's add an action that will ask whether to send the Slack message. To do that, click the + above the testing action and select 'Pass arguments':

Image loading...Pass arguments action

Configure the following details:

  • set the parameter name to SEND_MESSAGE
  • set the input mode to 'options'
  • set the value to YES and NO, each in a separate

Image loading...Action details

Now we can set the trigger condition for the Slack action:

  • go to the 'Condition' tab
  • select 'Run only if ENV VAR value has specific value'
  • set the condition to run only if SEND_MESSAGE is YES

Image loading...Setting up Slack actions

Running the pipeline

Once you trigger the pipeline, Buddy will ask if you want to send the Slack message:

Image loading...Entering the message

If you select 'NO' as the answer, the Slack action will be skipped from the execution:

Image loading...Pipeline with skipped Slack action

Input mode

When adding a parameter we select the input mode which defines the way the value will be entered by the user:

  • Input – the value is entered manually
  • Options – multiple values entered in a separate line each, selected from a dropdown
  • Options from file – the user selects a file with the options to choose from, each value in a separate line. This way you can store the options in the repository, or list them in a build action or another pipeline

Image loading...Pass arguments

Permissions, encryptions and default value

  • Enabling value encryption will blur it in the execution logs.
  • The default value, on the other hand, will suggest a specific value when prompted, so that you won't have to enter it manually every time.
  • Permissions let you specify which users or groups of users are allowed to define the values (e.g. admins only)

Image loading...Project permissions

Using parameters in build actions

All parameters are available in build actions as environment variables that can be used in Buddy's scripts. For example, to display the value of SEND_MESSAGE, you just need to refer to this variable in the script:

Image loading...Run tab

More from Buddy

Make sure to check out our articles on environment variables and trigger conditions to learn how Buddy can help you optimize your delivery workflow – and pull off more amazing stuff that makes us truly proud of what we created.

Cheers!

Warning
Buddy is 100% customer driven. If there’s a feature or integration you miss, let us know in the comments below or directly at support@buddy.works.
Jarek Dylewski

Jarek Dylewski

Customer Support

A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.

May 8th 2019
Last update: Sep 21st 2020
Share