diff --git a/.changeset/minor-remove-defaults-schema.md b/.changeset/minor-remove-defaults-schema.md new file mode 100644 index 0000000000..c644095711 --- /dev/null +++ b/.changeset/minor-remove-defaults-schema.md @@ -0,0 +1,5 @@ +--- +"gh-aw": minor +--- + +Remove "defaults" section from main JSON schema diff --git a/docs/src/content/docs/reference/frontmatter-full.md b/docs/src/content/docs/reference/frontmatter-full.md index 79e9b91b58..04f9837747 100644 --- a/docs/src/content/docs/reference/frontmatter-full.md +++ b/docs/src/content/docs/reference/frontmatter-full.md @@ -620,20 +620,6 @@ permissions: # (optional) run-name: "example-value" -# Default settings that will apply to all jobs in the workflow -# (optional) -defaults: - # Default shell and working directory - # (optional) - run: - # Default shell for run steps - # (optional) - shell: "example-value" - - # Default working directory for run steps - # (optional) - working-directory: "example-value" - # Groups together all the jobs that run in the workflow # (optional) jobs: diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 14a10a1446..c93ea90a83 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -317,7 +317,7 @@ var PriorityStepFields = []string{"name", "id", "if", "run", "uses", "script", " // PriorityJobFields defines the conventional field order for GitHub Actions workflow jobs // Fields appear in this order first, followed by remaining fields alphabetically -var PriorityJobFields = []string{"name", "runs-on", "needs", "if", "permissions", "environment", "concurrency", "outputs", "env", "defaults", "steps"} +var PriorityJobFields = []string{"name", "runs-on", "needs", "if", "permissions", "environment", "concurrency", "outputs", "env", "steps"} // PriorityWorkflowFields defines the conventional field order for top-level GitHub Actions workflow frontmatter // Fields appear in this order first, followed by remaining fields alphabetically diff --git a/pkg/parser/schema_test.go b/pkg/parser/schema_test.go index 1774f6180d..18b58db2d2 100644 --- a/pkg/parser/schema_test.go +++ b/pkg/parser/schema_test.go @@ -723,32 +723,6 @@ func TestValidateMainWorkflowFrontmatterWithSchema(t *testing.T) { }, wantErr: false, }, - { - name: "valid GitHub Actions defaults property", - frontmatter: map[string]any{ - "on": "push", - "defaults": map[string]any{ - "run": map[string]any{ - "shell": "bash", - "working-directory": "/app", - }, - }, - }, - wantErr: false, - }, - { - name: "invalid defaults with additional properties", - frontmatter: map[string]any{ - "defaults": map[string]any{ - "run": map[string]any{ - "shell": "bash", - "invalid_prop": "value", - }, - }, - }, - wantErr: true, - errContains: "additional properties 'invalid_prop' not allowed", - }, { name: "valid claude engine with network permissions", frontmatter: map[string]any{ diff --git a/pkg/parser/schemas/main_workflow_schema.json b/pkg/parser/schemas/main_workflow_schema.json index a1ba9f42d2..2b82980d6d 100644 --- a/pkg/parser/schemas/main_workflow_schema.json +++ b/pkg/parser/schemas/main_workflow_schema.json @@ -1070,28 +1070,6 @@ "type": "string", "description": "Custom name for workflow runs that appears in the GitHub Actions interface (supports GitHub expressions like ${{ github.event.issue.title }})" }, - "defaults": { - "type": "object", - "description": "Default settings that will apply to all jobs in the workflow", - "additionalProperties": false, - "properties": { - "run": { - "type": "object", - "description": "Default shell and working directory", - "additionalProperties": false, - "properties": { - "shell": { - "type": "string", - "description": "Default shell for run steps" - }, - "working-directory": { - "type": "string", - "description": "Default working directory for run steps" - } - } - } - } - }, "jobs": { "type": "object", "description": "Groups together all the jobs that run in the workflow", @@ -1194,9 +1172,6 @@ "type": "string" } }, - "defaults": { - "$ref": "#/properties/defaults" - }, "concurrency": { "$ref": "#/properties/concurrency" }