Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update python version as list #145

Merged

Conversation

sravs-dev
Copy link
Contributor

No description provided.

@cognifloyd
Copy link
Member

cognifloyd commented Dec 4, 2023

@sravs-dev
Copy link
Contributor Author

@cognifloyd @armab created a draft PR for stackstorm-git repo. Please let me know if the syntax is correct.

Copy link
Member

@cognifloyd cognifloyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang. This CI run shows that there's something wrong:
https://github.com/StackStorm-Exchange/stackstorm-git/actions/runs/7089455034

@@ -14,7 +14,7 @@ on:
python-version:
required: false
type: string
default: "3.6"
default: ["3.6","3.8","3.9"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now an array, not a string, but GHA only allows boolean, number, or string for input types:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_callinputsinput_idtype

So, we probably need to pass a json array in as a string, and then use the fromJSON function below.

Suggested change
default: ["3.6","3.8","3.9"]
default: '["3.6","3.8","3.9"]'

name: 'Python ${{ matrix.python-version }}'
strategy:
matrix:
include:
- python-version: ${{ inputs.python-version }}
python-version: ${{ inputs.python-version }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the input has to be a string, we need fromJSON here:
https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson

Suggested change
python-version: ${{ inputs.python-version }}
python-version: ${{ fromJSON(inputs.python-version) }}

@sravs-dev
Copy link
Contributor Author

@cognifloyd Thanks for reviewing. Made the suggested changes.

@sravs-dev
Copy link
Contributor Author

@cognifloyd looks like build got triggered for python 3.8 and python 3.9 as expected StackStorm-Exchange/stackstorm-git#15

@cognifloyd cognifloyd merged commit f6a25f5 into StackStorm-Exchange:master Dec 5, 2023
@arm4b
Copy link
Member

arm4b commented Dec 6, 2023

Thanks @sravs-dev and @cognifloyd !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants