Skip to content

Commit b57897d

Browse files
authored
Add lock-for-agent boolean field to issues trigger schema (#6210)
1 parent 64d1f44 commit b57897d

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

pkg/parser/schema_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,32 @@ func TestValidateMainWorkflowFrontmatterWithSchema(t *testing.T) {
452452
},
453453
wantErr: false,
454454
},
455+
{
456+
name: "valid frontmatter with issues trigger lock-for-agent field",
457+
frontmatter: map[string]any{
458+
"on": map[string]any{
459+
"issues": map[string]any{
460+
"types": []string{"opened"},
461+
"lock-for-agent": true,
462+
},
463+
},
464+
"permissions": "read",
465+
},
466+
wantErr: false,
467+
},
468+
{
469+
name: "valid frontmatter with issues trigger lock-for-agent false",
470+
frontmatter: map[string]any{
471+
"on": map[string]any{
472+
"issues": map[string]any{
473+
"types": []string{"opened"},
474+
"lock-for-agent": false,
475+
},
476+
},
477+
"permissions": "read",
478+
},
479+
wantErr: false,
480+
},
455481
{
456482
name: "valid frontmatter with updated pull_request trigger types",
457483
frontmatter: map[string]any{

pkg/parser/schemas/main_workflow_schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@
381381
}
382382
}
383383
]
384+
},
385+
"lock-for-agent": {
386+
"type": "boolean",
387+
"description": "Whether to lock the issue for the agent when the workflow runs (prevents concurrent modifications)"
384388
}
385389
}
386390
},

0 commit comments

Comments
 (0)