From 65f99b8c11787e2f59689991fd70fc4361ab1394 Mon Sep 17 00:00:00 2001 From: Nick Graef Date: Tue, 21 Apr 2020 18:00:07 -0500 Subject: [PATCH 1/4] add run defaults to github workflow schema --- src/schemas/json/github-workflow.json | 78 +++++++++++++++++++-------- 1 file changed, 57 insertions(+), 21 deletions(-) diff --git a/src/schemas/json/github-workflow.json b/src/schemas/json/github-workflow.json index b6e30e9d306..237840aa1b1 100644 --- a/src/schemas/json/github-workflow.json +++ b/src/schemas/json/github-workflow.json @@ -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": { @@ -232,12 +252,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": { @@ -742,6 +787,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..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.", @@ -860,6 +910,11 @@ "$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.", @@ -898,29 +953,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", From 9a32b8f18e2618f4efef4dbee57dd9691829aa63 Mon Sep 17 00:00:00 2001 From: Nick Graef Date: Tue, 21 Apr 2020 18:21:01 -0500 Subject: [PATCH 2/4] add continue-on-error to github workflow schema --- src/schemas/json/github-workflow.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/schemas/json/github-workflow.json b/src/schemas/json/github-workflow.json index 237840aa1b1..90f8c76488d 100644 --- a/src/schemas/json/github-workflow.json +++ b/src/schemas/json/github-workflow.json @@ -1059,6 +1059,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.", From 04ee83aba791b1bf2b767679f9175c940033d174 Mon Sep 17 00:00:00 2001 From: Nick Graef Date: Tue, 21 Apr 2020 21:45:19 -0500 Subject: [PATCH 3/4] add registry_package event to github workflow schema --- src/schemas/json/github-workflow.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/schemas/json/github-workflow.json b/src/schemas/json/github-workflow.json index 90f8c76488d..21e43e90bc2 100644 --- a/src/schemas/json/github-workflow.json +++ b/src/schemas/json/github-workflow.json @@ -153,6 +153,7 @@ "pull_request_review", "pull_request_review_comment", "push", + "registry_package", "release", "status", "watch", From 590f8bd35363ca6d7a7c4f2316e381d880c3b465 Mon Sep 17 00:00:00 2001 From: Nick Graef Date: Tue, 21 Apr 2020 22:02:44 -0500 Subject: [PATCH 4/4] add job outputs to github workflow schema --- src/schemas/json/github-workflow.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/schemas/json/github-workflow.json b/src/schemas/json/github-workflow.json index 21e43e90bc2..ba601c308ea 100644 --- a/src/schemas/json/github-workflow.json +++ b/src/schemas/json/github-workflow.json @@ -906,6 +906,15 @@ } ] }, + "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",