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

GitHub Action schema #850

Merged
merged 6 commits into from
Nov 7, 2019
Merged

GitHub Action schema #850

merged 6 commits into from
Nov 7, 2019

Conversation

Logerfo
Copy link
Contributor

@Logerfo Logerfo commented Nov 5, 2019

Based on the official documentation.
Also, see #853 for the workflow schema.

@Logerfo
Copy link
Contributor Author

Logerfo commented Nov 6, 2019

I think this is good to go.

@Logerfo Logerfo mentioned this pull request Nov 6, 2019
@madskristensen madskristensen merged commit 94bae80 into SchemaStore:master Nov 7, 2019
@madskristensen
Copy link
Contributor

Thanks

@Logerfo Logerfo deleted the patch-1 branch November 7, 2019 17:09
zhuravlikjb pushed a commit to zhuravlikjb/schemastore that referenced this pull request Nov 25, 2019
* Create github-action.json

* fixed args

* added to catalog

* added comments

* fixed sorting

* added runs.env
@ssbarnea
Copy link
Contributor

ssbarnea commented Oct 5, 2021

@Logerfo my expectation was that these schemas were programatelly produced so they could easily be updated.

For example I was hoping that python-version property to be evaluated as a string instead of allowing floats, which happen to work until one day ago, when 3.10 was released. Anyone trying to add just 3.10 without quotes will have the unpleasant surprise. Schema could help here but is not really clear where is this schema tracked.

@Logerfo
Copy link
Contributor Author

Logerfo commented Oct 5, 2021

@ssbarnea I've done this using my bare hands, but I can't find any property called python-version. Are you sure this is the schema you're having issues with?

@ssbarnea
Copy link
Contributor

ssbarnea commented Oct 5, 2021

Hmm, good question. I think I was looking for Workflow schema instead, but that neither has the the python-version in it.

Somehow I have the impression that it may not even be possible to do it because that is usually used inside matrix:. Take a look at the example from https://docs.github.com/en/enterprise-server@3.1/actions/automating-builds-and-tests/building-and-testing-nodejs-or-python?langId=py

Even their example is misleading because these should be treated as string, if you happen to try to add a 3.10 to that list it will not work correctly. Ideally the schema should be able to require that python-version is either a string or a list of strings.

I know that JSON schema supports that but I am not sure how easy it would be to add this for the matrix object, which acts mostly like a free-form dictionary.

@Logerfo
Copy link
Contributor Author

Logerfo commented Oct 5, 2021

@ssbarnea the matrix property is so complex that the schema should match any object:

"matrix": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix",
"description": "A build matrix is a set of different configurations of the virtual environment. For example you might run a job against more than one supported version of a language, operating system, or tool. Each configuration is a copy of the job that runs and reports a status.\nYou can specify a matrix by supplying an array for the configuration options. For example, if the GitHub virtual environment supports Node.js versions 6, 8, and 10 you could specify an array of those versions in the matrix.\nWhen you define a matrix of operating systems, you must set the required runs-on keyword to the operating system of the current job, rather than hard-coding the operating system name. To access the operating system name, you can use the matrix.os context parameter to set runs-on. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.",
"oneOf": [
{
"type": "object"
},
{
"$ref": "#/definitions/expressionSyntax"
}
],

@ssbarnea
Copy link
Contributor

ssbarnea commented Oct 6, 2021

It should not be too hard, I started working on a change at #1863

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