Skip to content

Commit 3dc868c

Browse files
committed
feature: adding keep-null-value-keys #780
1 parent 4b08990 commit 3dc868c

File tree

5 files changed

+20356
-65367
lines changed

5 files changed

+20356
-65367
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,25 @@ To tag your tasks:
366366
wait-for-task-stopped: true
367367
```
368368

369+
370+
## Preserving Empty Values with keep-null-value-keys
371+
372+
By default, this action removes empty string, array, and object values from the ECS task definition before registering it. If you want to preserve empty values for specific keys, use the `keep-null-value-keys` input. This is a comma-separated list of key names. When specified, any empty value for those keys will be kept in the registered task definition.
373+
374+
**Example:**
375+
376+
```yaml
377+
- name: Deploy to Amazon ECS
378+
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
379+
with:
380+
task-definition: task-definition.json
381+
service: my-service
382+
cluster: my-cluster
383+
keep-null-value-keys: tag,command,placementConstraints
384+
```
385+
386+
This is useful for cases where a default value is non-null and you want to override the value and set it to null.
387+
369388
## Troubleshooting
370389

371390
This action emits debug logs to help troubleshoot deployment failures. To see the debug logs, create a secret named `ACTIONS_STEP_DEBUG` with value `true` in your repository.

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ inputs:
8888
propagate-tags:
8989
description: "Determines to propagate the tags from the 'SERVICE' to the task."
9090
required: false
91+
keep-null-value-keys:
92+
description: 'A comma-separated list of keys whose empty values (empty string, array, or object) should be preserved in the task definition. By default, empty values are removed.'
93+
required: false
9194
outputs:
9295
task-definition-arn:
9396
description: 'The ARN of the registered ECS task definition.'

0 commit comments

Comments
 (0)