diff --git a/README.md b/README.md index 9914b86..96590a4 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The following parameters can be used as `step.with` keys: | Name | Type | Default | Required |Description | | ------------------ | ------ | ------- |--------- |--------------------------------- | -| `versions ` | String | | yes | Json Formatted List as a String | +| `versions ` | String | | yes | comma separated list of versions | ## Example usage @@ -23,5 +23,5 @@ jobs: - name: Generate docker build matrix uses: ednz-cloud/docker-matrix-generator@v1 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 ``` \ No newline at end of file diff --git a/action/matrix_generator.py b/action/matrix_generator.py index a34b2a3..6d678b6 100644 --- a/action/matrix_generator.py +++ b/action/matrix_generator.py @@ -48,10 +48,11 @@ def get_latest_versions(versions: List[str]) -> List[Dict[str, any]]: def main(): all_versions_str = os.environ.get("VERSION_LIST", "") - print(all_versions_str) - all_versions = json.loads(all_versions_str) + all_versions_list = [ + 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)