bash
runtime in language dropdownecho
is your friend.
Your echo
statements will print their output in the workflow step results:
$PATH
for you to use out of the box. These binaries include but aren’t limited to:
curl
for making HTTP requestsjq
for manipulating and viewing JSON datagit
for interacting with remote repositories/tmp
directory to download and install software from source.
$PIPEDREAM_STEPS
environment variable.
In this example, we’ll pretend this data is coming into our HTTP trigger via a POST request.
$PIPEDREAM_STEPS
file. Specifically, this data from the POST request into our workflow is available in the trigger
object.
.
) in front the trigger.event
in the example is not a typo. This is to define the starting point for jq
to traverse down the JSON in the HTTP response.$PIPEDREAM_EXPORTS
file.
$PIPEDREAM_EXPORTS
data shared between workflow steps.You can only export JSON-serializable data from Bash steps.$
in front of the environment variable name.
GET
requestcurl
to perform GET
requests.
--silent
flag with curl
to suppress extra extra diagnostic information that curl
produces when making requests.This enables you to only worry about the body of the response so you can visualize it with tools like echo
or jq
.POST
requestcurl
has an -h
flag where you can pass your API key as a token.
For example, here’s how to retrieve mentions from the Twitter API:
exit
function available in Bash to quit the step prematurely.
exit
to quit a Bash step early won’t stop the execution of the rest of the workflow.Exiting a Bash step will only apply that particular step in the workflow.stderr
which will appear in the results of the step in the workflow.
/tmp
directory.
/tmp
using curl
/tmp
directory does not have unlimited storage. Please refer to the disk limits for details.