Skip to content

Commit 6b2c9e7

Browse files
authored
Remove "defaults" section from main JSON schema (#2200)
1 parent bfca601 commit 6b2c9e7

File tree

5 files changed

+6
-66
lines changed

5 files changed

+6
-66
lines changed

.changeset/minor-remove-defaults-schema.md

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/content/docs/reference/frontmatter-full.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -620,20 +620,6 @@ permissions:
620620
# (optional)
621621
run-name: "example-value"
622622

623-
# Default settings that will apply to all jobs in the workflow
624-
# (optional)
625-
defaults:
626-
# Default shell and working directory
627-
# (optional)
628-
run:
629-
# Default shell for run steps
630-
# (optional)
631-
shell: "example-value"
632-
633-
# Default working directory for run steps
634-
# (optional)
635-
working-directory: "example-value"
636-
637623
# Groups together all the jobs that run in the workflow
638624
# (optional)
639625
jobs:

pkg/constants/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ var PriorityStepFields = []string{"name", "id", "if", "run", "uses", "script", "
317317

318318
// PriorityJobFields defines the conventional field order for GitHub Actions workflow jobs
319319
// Fields appear in this order first, followed by remaining fields alphabetically
320-
var PriorityJobFields = []string{"name", "runs-on", "needs", "if", "permissions", "environment", "concurrency", "outputs", "env", "defaults", "steps"}
320+
var PriorityJobFields = []string{"name", "runs-on", "needs", "if", "permissions", "environment", "concurrency", "outputs", "env", "steps"}
321321

322322
// PriorityWorkflowFields defines the conventional field order for top-level GitHub Actions workflow frontmatter
323323
// Fields appear in this order first, followed by remaining fields alphabetically

pkg/parser/schema_test.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -723,32 +723,6 @@ func TestValidateMainWorkflowFrontmatterWithSchema(t *testing.T) {
723723
},
724724
wantErr: false,
725725
},
726-
{
727-
name: "valid GitHub Actions defaults property",
728-
frontmatter: map[string]any{
729-
"on": "push",
730-
"defaults": map[string]any{
731-
"run": map[string]any{
732-
"shell": "bash",
733-
"working-directory": "/app",
734-
},
735-
},
736-
},
737-
wantErr: false,
738-
},
739-
{
740-
name: "invalid defaults with additional properties",
741-
frontmatter: map[string]any{
742-
"defaults": map[string]any{
743-
"run": map[string]any{
744-
"shell": "bash",
745-
"invalid_prop": "value",
746-
},
747-
},
748-
},
749-
wantErr: true,
750-
errContains: "additional properties 'invalid_prop' not allowed",
751-
},
752726
{
753727
name: "valid claude engine with network permissions",
754728
frontmatter: map[string]any{

pkg/parser/schemas/main_workflow_schema.json

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,28 +1070,6 @@
10701070
"type": "string",
10711071
"description": "Custom name for workflow runs that appears in the GitHub Actions interface (supports GitHub expressions like ${{ github.event.issue.title }})"
10721072
},
1073-
"defaults": {
1074-
"type": "object",
1075-
"description": "Default settings that will apply to all jobs in the workflow",
1076-
"additionalProperties": false,
1077-
"properties": {
1078-
"run": {
1079-
"type": "object",
1080-
"description": "Default shell and working directory",
1081-
"additionalProperties": false,
1082-
"properties": {
1083-
"shell": {
1084-
"type": "string",
1085-
"description": "Default shell for run steps"
1086-
},
1087-
"working-directory": {
1088-
"type": "string",
1089-
"description": "Default working directory for run steps"
1090-
}
1091-
}
1092-
}
1093-
}
1094-
},
10951073
"jobs": {
10961074
"type": "object",
10971075
"description": "Groups together all the jobs that run in the workflow",
@@ -1194,9 +1172,6 @@
11941172
"type": "string"
11951173
}
11961174
},
1197-
"defaults": {
1198-
"$ref": "#/properties/defaults"
1199-
},
12001175
"concurrency": {
12011176
"$ref": "#/properties/concurrency"
12021177
}

0 commit comments

Comments
 (0)