Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new arguments property to the script process #960

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dsl-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,8 @@ Enables the execution of custom scripts or code within a workflow, empowering wo
| language | `string` | `yes` | The language of the script to run |
| code | `string` | `no` | The script's code.<br>*Required if `source` has not been set.* |
| source | [externalResource](#external-resource) | `no` | The script's resource.<br>*Required if `code` has not been set.* |
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured process |
| arguments | `map` | `no` | A list of the arguments, if any, of the script to run |
| environment | `map` | `no` | A key/value mapping of the environment variables, if any, to use when running the configured script process |

###### Examples

Expand All @@ -803,8 +804,10 @@ do:
run:
script:
language: js
arguments:
greetings: Hello, world!
code: >
Some cool multiline script
console.log(greetings)
```

##### Shell Process
Expand Down
14 changes: 14 additions & 0 deletions examples/run-script-with-arguments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
document:
dsl: 1.0.0-alpha1
namespace: samples
name: run-script-with-arguments
version: 0.1.0
do:
- log:
run:
script:
language: javascript
arguments:
message: ${ .message }
code: >
console.log(message)
7 changes: 6 additions & 1 deletion schema/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,16 @@ $defs:
language:
type: string
description: The language of the script to run.
arguments:
title: ScriptArguments
type: object
additionalProperties: true
description: A key/value mapping of the arguments, if any, to use when running the configured script.
environment:
title: ScriptEnvironment
type: object
additionalProperties: true
description: A key/value mapping of the environment variables, if any, to use when running the configured process.
description: A key/value mapping of the environment variables, if any, to use when running the configured script process.
oneOf:
- title: ScriptInline
properties:
Expand Down
Loading