Skip to content

Commit

Permalink
GitHub workflow schema updates (#1012)
Browse files Browse the repository at this point in the history
* add run defaults to github workflow schema

* add continue-on-error to github workflow schema

* add registry_package event to github workflow schema

* add job outputs to github workflow schema
  • Loading branch information
ngraef authored Apr 22, 2020
1 parent 8eb728a commit 93953b1
Showing 1 changed file with 79 additions and 21 deletions.
100 changes: 79 additions & 21 deletions src/schemas/json/github-workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@
],
"additionalProperties": false
},
"defaults": {
"type": "object",
"properties": {
"run": {
"type": "object",
"properties": {
"shell": {
"$ref": "#/definitions/shell"
},
"working-directory": {
"$ref": "#/definitions/working-directory"
}
},
"minProperties": 1,
"additionalProperties": false
}
},
"minProperties": 1,
"additionalProperties": false
},
"env": {
"type": "object",
"additionalProperties": {
Expand Down Expand Up @@ -133,6 +153,7 @@
"pull_request_review",
"pull_request_review_comment",
"push",
"registry_package",
"release",
"status",
"watch",
Expand Down Expand Up @@ -232,12 +253,37 @@
}
]
},
"shell": {
"$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell",
"description": "You can override the default shell settings in the runner's operating system using the shell keyword. You can use built-in shell keywords, or you can define a custom set of shell options.",
"type": "string",
"anyOf": [
{
"$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#custom-shell"
},
{
"enum": [
"bash",
"pwsh",
"python",
"sh",
"cmd",
"powershell"
]
}
]
},
"types": {
"$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#onevent_nametypes",
"description": "Selects the types of activity that will trigger a workflow run. Most GitHub events are triggered by more than one type of activity. For example, the event for the release resource is triggered when a release is published, unpublished, created, edited, deleted, or prereleased. The types keyword enables you to narrow down activity that causes the workflow to run. When only one activity type triggers a webhook event, the types keyword is unnecessary.\nYou can use an array of event types. For more information about each event and their activity types, see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events.",
"type": "array",
"minItems": 1,
"additionalItems": false
},
"working-directory": {
"$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsrun",
"description": "Using the working-directory keyword, you can specify the working directory of where to run the command.",
"type": "string"
}
},
"properties": {
Expand Down Expand Up @@ -742,6 +788,11 @@
"$ref": "#/definitions/env",
"description": "A map of environment variables that are available to all jobs and steps in the workflow."
},
"defaults": {
"$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaults",
"$ref": "#/definitions/defaults",
"description": "A map of default settings that will apply to all jobs in the workflow."
},
"jobs": {
"$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobs",
"description": "A workflow run is made up of one or more jobs. Jobs run in parallel by default. To run jobs sequentially, you can define dependencies on other jobs using the jobs.<job_id>.needs keyword.\nEach job runs in a fresh instance of the virtual environment specified by runs-on.\nYou can run an unlimited number of jobs as long as you are within the workflow usage limits. For more information, see https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#usage-limits.",
Expand Down Expand Up @@ -855,11 +906,25 @@
}
]
},
"outputs": {
"$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjobs_idoutputs",
"description": "A map of outputs for a job. Job outputs are available to all downstream jobs that depend on this job.",
"type": "object",
"additionalProperties": {
"type": "string"
},
"minProperties": 1
},
"env": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idenv",
"$ref": "#/definitions/env",
"description": "A map of environment variables that are available to all steps in the job."
},
"defaults": {
"$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaults",
"$ref": "#/definitions/defaults",
"description": "A map of default settings that will apply to all steps in the job."
},
"if": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idif",
"description": "You can use the if conditional to prevent a job from running unless a condition is met. You can use any supported context and expression to create a conditional.\nExpressions in an if conditional do not require the ${{ }} syntax. For more information, see https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions.",
Expand Down Expand Up @@ -898,29 +963,10 @@
"type": "string"
},
"working-directory": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsrun",
"description": "Using the working-directory keyword, you can specify the working directory of where to run the command.",
"type": "string"
"$ref": "#/definitions/working-directory"
},
"shell": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell",
"description": "You can override the default shell settings in the virtual environment's operating system using the shell keyword. You can use built-in shell keywords, or you can define a custom set of shell options.",
"type": "string",
"anyOf": [
{
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#custom-shell"
},
{
"enum": [
"bash",
"pwsh",
"python",
"sh",
"cmd",
"powershell"
]
}
]
"$ref": "#/definitions/shell"
},
"with": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepswith",
Expand Down Expand Up @@ -1023,6 +1069,18 @@
],
"additionalProperties": false
},
"continue-on-error": {
"$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error",
"description": "Prevents a workflow run from failing when a job fails. Set to true to allow a workflow run to pass when this job fails.",
"oneOf": [
{
"type": "boolean"
},
{
"type": "string"
}
]
},
"container": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainer",
"description": "A container to run any steps in a job that don't already specify a container. If you have steps that use both script and container actions, the container actions will run as sibling containers on the same network with the same volume mounts.\nIf you do not set a container, all steps will run directly on the host specified by runs-on unless a step refers to an action configured to run in a container.",
Expand Down

0 comments on commit 93953b1

Please sign in to comment.