Skip to content

Commit

Permalink
chore: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Jan 16, 2024
1 parent 4552c14 commit 79b2d77
Showing 1 changed file with 46 additions and 120 deletions.
166 changes: 46 additions & 120 deletions __tests__/helpers/github-workflow-schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions",
"$id": "https://json.schemastore.org/github-workflow.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/github-workflow.json",
"$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions",
"additionalProperties": false,
"definitions": {
"architecture": { "type": "string", "enum": ["ARM32", "x64", "x86"] },
Expand Down Expand Up @@ -191,13 +191,13 @@
},
"eventObject": { "oneOf": [{ "type": "object" }, { "type": "null" }], "additionalProperties": true },
"expressionSyntax": {
"type": "string",
"$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)",
"type": "string",
"pattern": "^\\$\\{\\{(.|[\r\n])*\\}\\}$"
},
"stringContainingExpressionSyntax": {
"type": "string",
"$comment": "escape `{` and `}` in pattern to be unicode compatible (#1360)",
"type": "string",
"pattern": "^.*\\$\\{\\{(.|[\r\n])*\\}\\}.*$"
},
"globs": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1 },
Expand Down Expand Up @@ -235,8 +235,8 @@
"anyOf": [
{ "type": "string" },
{
"type": "string",
"$comment": "https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#custom-shell",
"type": "string",
"enum": ["bash", "pwsh", "python", "sh", "cmd", "powershell"]
}
]
Expand All @@ -260,6 +260,31 @@
{ "$ref": "#/definitions/name" }
]
},
"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" }],
"patternProperties": {
"^(in|ex)clude$": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build",
"oneOf": [
{ "$ref": "#/definitions/expressionSyntax" },
{
"type": "array",
"items": { "type": "object", "additionalProperties": { "$ref": "#/definitions/configuration" } },
"minItems": 1
}
]
}
},
"additionalProperties": {
"oneOf": [
{ "type": "array", "items": { "$ref": "#/definitions/configuration" }, "minItems": 1 },
{ "$ref": "#/definitions/expressionSyntax" }
]
},
"minProperties": 1
},
"reusableWorkflowCallJob": {
"$comment": "https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#calling-a-reusable-workflow",
"description": "Each job must have an id to associate with the job. The key job_id is a string and its value is a map of the job's configuration data. You must replace <job_id> with a string that is unique to the jobs object. The <job_id> must start with a letter or _ and contain only alphanumeric characters, -, or _.",
Expand All @@ -271,7 +296,7 @@
"type": "string"
},
"needs": { "$ref": "#/definitions/jobNeeds" },
"permissions": { "$ref": "#/definitions/permissions-event" },
"permissions": { "$ref": "#/definitions/permissions" },
"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 All @@ -285,8 +310,8 @@
},
"with": {
"$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idwith",
"description": "A map of inputs that are passed to the called workflow. Any inputs that you pass must match the input specifications defined in the called workflow. Unlike 'jobs.<job_id>.steps[*].with', the inputs you pass with 'jobs.<job_id>.with' are not be available as environment variables in the called workflow. Instead, you can reference the inputs by using the inputs context.",
"$ref": "#/definitions/env"
"$ref": "#/definitions/env",
"description": "A map of inputs that are passed to the called workflow. Any inputs that you pass must match the input specifications defined in the called workflow. Unlike 'jobs.<job_id>.steps[*].with', the inputs you pass with 'jobs.<job_id>.with' are not be available as environment variables in the called workflow. Instead, you can reference the inputs by using the inputs context."
},
"secrets": {
"$comment": "https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idsecrets",
Expand All @@ -298,30 +323,11 @@
"description": "A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in.",
"type": "object",
"properties": {
"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" }],
"patternProperties": {
"^(in|ex)clude$": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build",
"type": "array",
"items": { "type": "object", "additionalProperties": { "$ref": "#/definitions/configuration" } },
"minItems": 1
}
},
"additionalProperties": {
"oneOf": [
{ "type": "array", "items": { "$ref": "#/definitions/configuration" }, "minItems": 1 },
{ "$ref": "#/definitions/expressionSyntax" }
]
},
"minProperties": 1
},
"matrix": { "$ref": "#/definitions/matrix" },
"fail-fast": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast",
"description": "When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true",
"type": "boolean",
"type": ["boolean", "string"],
"default": true
},
"max-parallel": {
Expand Down Expand Up @@ -357,79 +363,15 @@
"runs-on": {
"$comment": "https://help.github.com/en/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on",
"description": "The type of machine to run the job on. The machine can be either a GitHub-hosted runner, or a self-hosted runner.",
"oneOf": [
"anyOf": [
{
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#github-hosted-runners",
"type": "string",
"enum": [
"macos-10.15",
"macos-11",
"macos-12",
"macos-12-xl",
"macos-13",
"macos-13-xl",
"macos-latest",
"macos-latest-xl",
"self-hosted",
"ubuntu-18.04",
"ubuntu-20.04",
"ubuntu-22.04",
"ubuntu-latest",
"ubuntu-latest-4-cores",
"ubuntu-latest-8-cores",
"ubuntu-latest-16-cores",
"windows-2019",
"windows-2022",
"windows-latest",
"windows-latest-8-cores"
]
"type": "string"
},
{
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#self-hosted-runners",
"type": "array",
"anyOf": [
{ "items": [{ "const": "self-hosted" }], "minItems": 1, "additionalItems": { "type": "string" } },
{
"items": [{ "const": "self-hosted" }, { "$ref": "#/definitions/machine" }],
"minItems": 2,
"additionalItems": { "type": "string" }
},
{
"items": [{ "const": "self-hosted" }, { "$ref": "#/definitions/architecture" }],
"minItems": 2,
"additionalItems": { "type": "string" }
},
{
"items": [
{ "const": "self-hosted" },
{ "$ref": "#/definitions/machine" },
{ "$ref": "#/definitions/architecture" }
],
"minItems": 3,
"additionalItems": { "type": "string" }
},
{
"items": [
{ "const": "self-hosted" },
{ "$ref": "#/definitions/architecture" },
{ "$ref": "#/definitions/machine" }
],
"minItems": 3,
"additionalItems": { "type": "string" }
},
{
"items": [{ "const": "linux" }],
"minItems": 2,
"maxItems": 2,
"additionalItems": { "type": "string" }
},
{
"items": [{ "const": "windows" }],
"minItems": 2,
"maxItems": 2,
"additionalItems": { "type": "string" }
}
]
"anyOf": [{ "items": [{ "type": "string" }], "minItems": 1 }]
},
{
"$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-runners-in-a-group",
Expand All @@ -439,7 +381,8 @@
"labels": { "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }
}
},
{ "$ref": "#/definitions/stringContainingExpressionSyntax" }
{ "$ref": "#/definitions/stringContainingExpressionSyntax" },
{ "$ref": "#/definitions/expressionSyntax" }
]
},
"environment": {
Expand Down Expand Up @@ -561,30 +504,11 @@
"description": "A strategy creates a build matrix for your jobs. You can define different variations of an environment to run each job in.",
"type": "object",
"properties": {
"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" }],
"patternProperties": {
"^(in|ex)clude$": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#example-including-configurations-in-a-matrix-build",
"type": "array",
"items": { "type": "object", "additionalProperties": { "$ref": "#/definitions/configuration" } },
"minItems": 1
}
},
"additionalProperties": {
"oneOf": [
{ "type": "array", "items": { "$ref": "#/definitions/configuration" }, "minItems": 1 },
{ "$ref": "#/definitions/expressionSyntax" }
]
},
"minProperties": 1
},
"matrix": { "$ref": "#/definitions/matrix" },
"fail-fast": {
"$comment": "https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast",
"description": "When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true",
"type": "boolean",
"type": ["boolean", "string"],
"default": true
},
"max-parallel": {
Expand Down Expand Up @@ -939,6 +863,8 @@
"ready_for_review",
"locked",
"unlocked",
"milestoned",
"demilestoned",
"review_requested",
"review_request_removed",
"auto_merge_enabled",
Expand Down Expand Up @@ -1161,8 +1087,8 @@
"description": "A string representing the default value. The default value is used when an input parameter isn't specified in a workflow file."
},
"type": {
"description": "A string representing the type of the input.",
"$comment": "https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputsinput_idtype",
"description": "A string representing the type of the input.",
"type": "string",
"enum": ["string", "choice", "boolean", "number", "environment"]
},
Expand Down Expand Up @@ -1211,7 +1137,7 @@
"properties": {
"types": {
"$ref": "#/definitions/types",
"items": { "type": "string", "enum": ["requested", "completed"] },
"items": { "type": "string", "enum": ["requested", "completed", "in_progress"] },
"default": ["requested", "completed"]
},
"workflows": { "type": "array", "items": { "type": "string" }, "minItems": 1 }
Expand Down

0 comments on commit 79b2d77

Please sign in to comment.