From 1f0c7bf89a08e8c74abaff12dedf3b934e31fc6e Mon Sep 17 00:00:00 2001 From: Stephen Price Date: Thu, 26 Oct 2023 14:28:34 -0700 Subject: [PATCH 1/2] remove required strings --- src/schemas/json/github-workflow.json | 122 ++------------------------ 1 file changed, 7 insertions(+), 115 deletions(-) diff --git a/src/schemas/json/github-workflow.json b/src/schemas/json/github-workflow.json index d442ac393c4..52ca6be583d 100644 --- a/src/schemas/json/github-workflow.json +++ b/src/schemas/json/github-workflow.json @@ -569,32 +569,10 @@ "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", @@ -603,99 +581,10 @@ { "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" + "type": "string" } ], - "minItems": 2, - "maxItems": 2, - "additionalItems": { - "type": "string" - } + "minItems": 1 } ] }, @@ -723,6 +612,9 @@ }, { "$ref": "#/definitions/stringContainingExpressionSyntax" + }, + { + "$ref": "#/definitions/expressionSyntax" } ] }, From 9cb1fd184ffc14ae7a9dcf6ec23f2e38bd7509d1 Mon Sep 17 00:00:00 2001 From: Stephen Price Date: Thu, 26 Oct 2023 14:28:46 -0700 Subject: [PATCH 2/2] fix negative test --- src/negative_test/github-workflow/runs-on.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/negative_test/github-workflow/runs-on.yaml b/src/negative_test/github-workflow/runs-on.yaml index 02f433d3833..2bdb1101b9d 100644 --- a/src/negative_test/github-workflow/runs-on.yaml +++ b/src/negative_test/github-workflow/runs-on.yaml @@ -6,11 +6,5 @@ on: jobs: self-hosted-custom: runs-on: - - self-hosted - - x86 - - windows - - gpu - - large - - 5 steps: - run: echo 'Hello from self-hosted ${{ runner.os }}'