Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,8 @@ var PriorityJobFields = []string{"name", "runs-on", "needs", "if", "permissions"
var PriorityWorkflowFields = []string{"on", "permissions", "if", "network", "imports", "safe-outputs", "steps"}

// IgnoredFrontmatterFields are fields that should be silently ignored during frontmatter validation
// NOTE: This is now empty as description and applyTo are properly validated by the schema
var IgnoredFrontmatterFields = []string{}
// NOTE: user-invokable is a GitHub Copilot custom agent field that is not part of the gh-aw schema
var IgnoredFrontmatterFields = []string{"user-invokable"}
Comment on lines 865 to +867
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that IgnoredFrontmatterFields is non-empty again, the comment on filterIgnoredFields in pkg/parser/schema_utilities.go (“currently does nothing”) is no longer accurate. Please update that comment to reflect that it actively filters the configured ignored fields (currently user-invokable) so future changes don’t get misled.

See below for a potential fix:

// IgnoredFrontmatterFields are frontmatter fields that are actively filtered out during validation.
// Parser utilities (e.g., filterIgnoredFields) use this list to drop non-schema fields without errors.
// NOTE: user-invokable is a GitHub Copilot custom agent field that is not part of the gh-aw schema.

Copilot uses AI. Check for mistakes.

// SharedWorkflowForbiddenFields lists fields that cannot be used in shared/included workflows.
// These fields are only allowed in main workflows (workflows with an 'on' trigger field).
Expand Down
21 changes: 21 additions & 0 deletions pkg/parser/schema_utilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ func TestFilterIgnoredFields(t *testing.T) {
"engine": "claude",
},
},
{
name: "frontmatter with user-invokable - should be filtered",
frontmatter: map[string]any{
"user-invokable": true,
"on": "push",
"engine": "claude",
},
expected: map[string]any{
"on": "push",
"engine": "claude",
},
},
}

for _, tt := range tests {
Expand Down Expand Up @@ -156,6 +168,15 @@ func TestValidateMainWorkflowWithIgnoredFields(t *testing.T) {
},
wantErr: false,
},
{
name: "valid frontmatter with user-invokable field - should be ignored",
frontmatter: map[string]any{
"on": "push",
"user-invokable": true,
"engine": "claude",
Comment on lines +172 to +176
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new ignored field is covered for main-workflow validation, but there’s no test asserting that ValidateIncludedFileFrontmatterWithSchema also ignores user-invokable. Since filterIgnoredFields is used by both main and included file validators, please add a test case in TestValidateIncludedFileWithIgnoredFields where frontmatter includes user-invokable: true and ensure validation succeeds (and that other invalid fields still fail).

Copilot uses AI. Check for mistakes.
},
wantErr: false,
},
{
name: "invalid frontmatter with ignored fields - other validation should still work",
frontmatter: map[string]any{
Expand Down
Loading