feat(action): do not require json formatted list, but comme separated list
This commit is contained in:
parent
a6575ebcdb
commit
794ca36d86
@ -9,7 +9,7 @@ The following parameters can be used as `step.with` keys:
|
|||||||
|
|
||||||
| Name | Type | Default | Required |Description |
|
| Name | Type | Default | Required |Description |
|
||||||
| ------------------ | ------ | ------- |--------- |--------------------------------- |
|
| ------------------ | ------ | ------- |--------- |--------------------------------- |
|
||||||
| `versions ` | String | | yes | Json Formatted List as a String |
|
| `versions ` | String | | yes | comma separated list of versions |
|
||||||
|
|
||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
@ -23,5 +23,5 @@ jobs:
|
|||||||
- name: Generate docker build matrix
|
- name: Generate docker build matrix
|
||||||
uses: ednz-cloud/docker-matrix-generator@v1
|
uses: ednz-cloud/docker-matrix-generator@v1
|
||||||
with:
|
with:
|
||||||
versions: '["2.2.8","2.2.7","2.2.4","2.2.3","2.1.5","2.1.4","2.1.3","2.1.2","2.1.1","2.1.0","2.0.20","2.0.19","2.0.18","2.0.17","2.0.16","2.0.15","2.0.14","2.0.13"]'
|
versions: 2.2.8, 2.2.7, 2.2.4, 2.2.3
|
||||||
```
|
```
|
@ -48,10 +48,11 @@ def get_latest_versions(versions: List[str]) -> List[Dict[str, any]]:
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
all_versions_str = os.environ.get("VERSION_LIST", "")
|
all_versions_str = os.environ.get("VERSION_LIST", "")
|
||||||
print(all_versions_str)
|
all_versions_list = [
|
||||||
all_versions = json.loads(all_versions_str)
|
version.strip() for version in all_versions_str.split(",") if version.strip()
|
||||||
|
]
|
||||||
|
|
||||||
version_objects = get_latest_versions(all_versions)
|
version_objects = get_latest_versions(all_versions_list)
|
||||||
|
|
||||||
value = json.dumps(version_objects)
|
value = json.dumps(version_objects)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user