Skip to content

Commit 6ab18a6

Browse files
committed
update docs
1 parent 29a87db commit 6ab18a6

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ As seen above, we have two steps. One for a noop deploy, and one for a regular d
309309
| `actor` | The GitHub handle of the actor that invoked the IssueOps command |
310310
| `environment` | The environment that has been selected for a deployment |
311311
| `params` | The raw parameters that were passed into the deployment command (see param_separator) - Further [documentation](docs/parameters.md) |
312+
| `parsed_params` | A stringified JSON object of the parsed parameters that were passed into the deployment command - Further [documentation](docs/parameters.md) |
312313
| `noop` | The string "true" if the noop trigger was found, otherwise the string "false" - Use this to conditionally control whether your deployment runs as a noop or not |
313314
| `sha` | The sha of the branch to be deployed |
314315
| `default_branch_tree_sha` | The sha of the default branch tree (useful for subsequent workflow steps if they need to do commit comparisons) |

docs/parameters.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ Here are a few examples of how to pass in parameters to the `.deploy` command an
1414
.deploy to development | LOG_LEVEL=debug,CPU_CORES=4
1515
```
1616

17-
**Outputs**: `params` = `LOG_LEVEL=debug,CPU_CORES=4`
17+
**Outputs**:
18+
19+
- `params` = `LOG_LEVEL=debug,CPU_CORES=4`
20+
- `parsed_params` = `["LOG_LEVEL=debug,CPU_CORES=4"]`
1821

1922
**Why**: A user might need to deploy to the development environment and tell subsequent workflow steps to use a `LOG_LEVEL` of `debug` and `CPU_CORES` of `4`.
2023

@@ -26,10 +29,28 @@ Here are a few examples of how to pass in parameters to the `.deploy` command an
2629
.deploy | something1 something2 something3
2730
```
2831

29-
**Outputs**: `params` = `something1 something2 something3`
32+
**Outputs**:
33+
34+
- `params` = `something1 something2 something3`
35+
- `parsed_params` = `["something1", "something2", "something3"]`
3036

3137
**Why**: This example shows that the `params` output is just a string that can be literally anything your heart desires. It is up to the user to parse the string and use it in subsequent steps.
3238

39+
### Example 3
40+
41+
**Command**:
42+
43+
```text
44+
.deploy | --cpu=2 --memory=4G --env=development --port=8080 --name=my-app -q my-queue
45+
```
46+
47+
**Outputs**:
48+
49+
- `params` = `--cpu=2 --memory=4G --env=development --port=8080 --name=my-app -q my-queue`
50+
- `parsed_params` = `{_: [], cpu: 2, memory: '4G', env: 'development', port: 8080, name: 'my-app', q: 'my-queue'}`
51+
52+
**Why**: This example shows that by using structure within your params string like `--key=value`, they can be automatically parsed into a JSON object and saved as the `parsed_params` output. This can be useful for users that want to pass in a number of parameters to their deployment and have them automatically parsed and saved as a JSON object as an output of this Action. Having machine readable output can be quite useful for subsequent workflow steps.
53+
3354
## Parameter Separator
3455

3556
The `param_separator` input defaults to `|` and will collect any text that is provided after this character and save it as a GitHub Actions output called `params`. This output can then be used in subsequent steps.
@@ -38,7 +59,7 @@ This value can be configured to be any character (or string) that you want.
3859

3960
## Parameter Output
4061

41-
The `params` output can be accessed just like any other output from the `branch-deploy` Action. Here is a quick example:
62+
The `params` and `parsed_params` outputs can be accessed just like any other output from the `branch-deploy` Action. Here is a quick example:
4263

4364
```yaml
4465
- name: branch-deploy
@@ -52,4 +73,5 @@ The `params` output can be accessed just like any other output from the `branch-
5273
if: steps.branch-deploy.outputs.continue == 'true'
5374
run: |
5475
echo "params: ${{ steps.branch-deploy.outputs.params }}"
76+
echo "parsed_params: ${{ steps.branch-deploy.outputs.parsed_params }}"
5577
```

0 commit comments

Comments
 (0)