From 7285b7dcc965933357dfc31b4d513a04fa8c7aef Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Wed, 29 Nov 2023 14:50:47 +0200 Subject: [PATCH] fix(script): Take into account arguments with `=` --- .github/workflows/full-bundle-tests.yaml | 2 +- scripts/get_release_from_bundle_source.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/full-bundle-tests.yaml b/.github/workflows/full-bundle-tests.yaml index f32c90b6..9ddd1e51 100644 --- a/.github/workflows/full-bundle-tests.yaml +++ b/.github/workflows/full-bundle-tests.yaml @@ -139,7 +139,7 @@ jobs: - name: Get release from bundle-source input id: get-release-from-bundle-source - run: python scripts/get_release_from_bundle_source.py ${{ inputs.bundle-source }} + run: python scripts/get_release_from_bundle_source.py "${{ inputs.bundle-source }}" - name: Get bundle test path for ${{ steps.get-release-from-bundle-source.outputs.release }} id: bundle-test-path diff --git a/scripts/get_release_from_bundle_source.py b/scripts/get_release_from_bundle_source.py index a28d8153..11682a40 100755 --- a/scripts/get_release_from_bundle_source.py +++ b/scripts/get_release_from_bundle_source.py @@ -9,13 +9,16 @@ def get_release_from_bundle_source() -> None: bundle_source = sys.argv[1] # Bundle source input should be `--channel ` or `--file .yaml`` - # e.g. --channel=1.8/stable or --file=releases/1.8/stable/kubeflow/bundle.yaml + # e.g. --channel 1.8/stable or --file releases/1.8/stable/kubeflow/bundle.yaml bundle_source_starts_with_channel = re.search("^--channel", bundle_source) bundle_source_starts_with_file = re.search("^--file", bundle_source) try: if bundle_source_starts_with_channel: - substrings = bundle_source.split('=') + if re.search("^--channel=", bundle_source): + substrings = bundle_source.split("=") + else: + substrings = bundle_source.split(" ") release=substrings[1] elif bundle_source_starts_with_file: substrings = bundle_source.split('/')