Skip to content

Commit

Permalink
fix(script): Take into account arguments with =
Browse files Browse the repository at this point in the history
  • Loading branch information
orfeas-k committed Nov 29, 2023
1 parent 56e878b commit 7285b7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/full-bundle-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions scripts/get_release_from_bundle_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ def get_release_from_bundle_source() -> None:

bundle_source = sys.argv[1]
# Bundle source input should be `--channel <channel_name>` or `--file <bundle_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('/')
Expand Down

0 comments on commit 7285b7d

Please sign in to comment.