functionbuilder
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nathan Coad
2023-02-10 17:21:49 +11:00
parent 1f1e172f2e
commit c2bc2c7e4a
4 changed files with 17 additions and 24 deletions

View File

@@ -24,7 +24,7 @@ functions:
image: registry.coadcorp.com/export-xlsx:1.0
type: knative-workflow
```
#### Rely on Direktiv to create input file
#### Basic
```yaml
- id: export-xlsx
type: action
@@ -38,16 +38,19 @@ functions:
worksheet-name: "TestSpreadsheet"
out-filename: example.xlsx
```
#### Use function to create input file
#### Use jq to add a parent key 'input' containing array of objects
```yaml
- id: export-xlsx
type: action
action:
function: export-xlsx
input:
input:
files:
- name: input.json
data: |
jq(.array | {input: . } | tostring )
worksheet-name: "TestSpreadsheet"
out-filename: example.xlsx
in-data: jq(.array | tostring)
out-filename: example.xlsx
```
### Secrets
@@ -113,7 +116,6 @@ functions:
| Name | Type | Go type | Required | Default | Description | Example |
|------|------|---------|:--------:| ------- |-------------|---------|
| files | [][DirektivFile](#direktiv-file)| `[]apps.DirektivFile` | | | File to create before running commands. | |
| in-data | [interface{}](#interface)| `interface{}` | | | json input to convert to spreadsheet | |
| infile | string| `string` | | | Name of the json input file to utilise | |
| out-filename | string| `string` | ✓ | `"output.xlsx"`| the filename of the output spreadsheet | |
| worksheet-name | string| `string` | ✓ | `"Sheet1"`| Label for the worksheet created in the spreadsheet | |