diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index c6f02e25..ffa740d9 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -51,7 +51,7 @@ - name: Generate new output files run: | pipenv run python scripts/convert.py -l all -t all -s all - pipenv run python scripts/gen_mappings.py --cres source/cre-mappings.yaml --target output/owasp_cornucopia_ecommerce_cre_mapping_1.30.json --lang source/ecommerce-cards-1.30-en.yaml + pipenv run python scripts/gen_mappings.py --cres source/cre-mappings.yaml --target output/owasp_cornucopia_ecommerce_cre_mapping_en_1.30.json --lang source/ecommerce-cards-1.30-en.yaml - uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1 name: "Create pre-release" with: @@ -126,5 +126,6 @@ output/owasp_cornucopia_ecommerce_cards_pt-br_1.30_static.docx output/owasp_cornucopia_ecommerce_cards_pt-br_1.30_static.idml output/owasp_cornucopia_ecommerce_cards_pt-br_1.30_static.pdf + output/owasp_cornucopia_ecommerce_cre_mapping_en_1.30.json README.md source/*.yaml \ No newline at end of file diff --git a/.github/workflows/run-tests-generate-output.yaml b/.github/workflows/run-tests-generate-output.yaml index b295f74c..35bf1d85 100644 --- a/.github/workflows/run-tests-generate-output.yaml +++ b/.github/workflows/run-tests-generate-output.yaml @@ -85,7 +85,7 @@ jobs: - name: Generate new output files run: | pipenv run python scripts/convert.py -l all -t all -s all - pipenv run python scripts/gen_mappings.py --cres source/cre-mappings.yaml --target output/owasp_cornucopia_ecommerce_cre_mapping_1.30.json --lang source/ecommerce-cards-1.30-en.yaml + pipenv run python scripts/gen_mappings.py --cres source/cre-mappings.yaml --target output/owasp_cornucopia_ecommerce_cre_mapping_en_1.30.json --lang source/ecommerce-cards-1.30-en.yaml - name: Create pull request artifacts uses: gavv/pull-request-artifacts@93f32f061d1fabdb41104db2493f2260c7db774f # v2.1 with: @@ -156,4 +156,4 @@ jobs: output/owasp_cornucopia_ecommerce_cards_pt-br_1.30_static.docx output/owasp_cornucopia_ecommerce_cards_pt-br_1.30_static.idml output/owasp_cornucopia_ecommerce_cards_pt-br_1.30_static.pdf - output/owasp_cornucopia_ecommerce_cre_mapping_1.30.json + output/owasp_cornucopia_ecommerce_cre_mapping_en_1.30.json diff --git a/scripts/gen_mappings.py b/scripts/gen_mappings.py index 7342251b..6a78ae65 100644 --- a/scripts/gen_mappings.py +++ b/scripts/gen_mappings.py @@ -6,12 +6,16 @@ from typing import Any, Dict base_url = "https://github.com/OWASP/cornucopia/wiki/" -CORNUCOPIA_VERSION = "1.30" def produce_ecommerce_mappings(source_file: Dict[Any, Any], language_mapping: Dict[Any, Any]) -> Dict[Any, Any]: base = { - "meta": {"edition": "ecommerce", "component": "mappings", "language": "ALL", "version": CORNUCOPIA_VERSION}, + "meta": { + "edition": "ecommerce", + "component": "mappings", + "language": language_mapping["meta"]["language"], + "version": language_mapping["meta"]["version"] + }, "standards": [], } for indx, suit in enumerate(source_file.copy()["suits"]): diff --git a/tests/scripts/gen_mappings_utest.py b/tests/scripts/gen_mappings_utest.py index b06ea5f8..0ce3c1bb 100644 --- a/tests/scripts/gen_mappings_utest.py +++ b/tests/scripts/gen_mappings_utest.py @@ -24,7 +24,7 @@ def test_can_produce_ecommerce_mappings(self): ] } expected = { - "meta": {"component": "mappings", "edition": "ecommerce", "language": "ALL", "version": "1.30"}, + "meta": {"component": "mappings", "edition": "ecommerce", "language": "EN", "version": "1.30"}, "standards": [ { "doctype": "Tool",