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
3 changes: 1 addition & 2 deletions .github/workflows/schema-consistency-checker.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .github/workflows/schema-consistency-checker.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ Strategy database structure:

**Key files to analyze:**
- `pkg/parser/schemas/main_workflow_schema.json`
- `pkg/parser/schemas/included_file_schema.json`
- `pkg/parser/schemas/mcp_config_schema.json`
- `pkg/parser/frontmatter.go` and `pkg/parser/*.go`
- `pkg/workflow/compiler.go` - main workflow compiler
Expand All @@ -96,7 +95,7 @@ Strategy database structure:
- `pkg/workflow/engine_firewall_support.go` - firewall support checking
- `pkg/workflow/strict_mode.go` - strict mode validation
- `pkg/workflow/stop_after.go` - stop-after processing
- `pkg/workflow/safe_jobs.go` - safe-jobs configuration
- `pkg/workflow/safe_jobs.go` - safe-jobs configuration (internal - accessed via safe-outputs.jobs)
- `pkg/workflow/runtime_setup.go` - runtime overrides
- `pkg/workflow/github_token.go` - github-token configuration
- `pkg/workflow/*.go` (all workflow processing files that use frontmatter)
Expand Down
3 changes: 3 additions & 0 deletions docs/src/content/docs/reference/safe-outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ The agent requests issue creation; a separate job with `issues: write` creates i

Create custom post-processing jobs registered as Model Context Protocol (MCP) tools. Support standard GitHub Actions properties and auto-access agent output via `$GH_AW_AGENT_OUTPUT`. See [Custom Safe Output Jobs](/gh-aw/guides/custom-safe-outputs/).

> [!NOTE]
> **Internal Implementation**: Custom safe output jobs are internally referred to as "safe-jobs" in the compiler code (`pkg/workflow/safe_jobs.go`), but they are user-facing only through the `safe-outputs.jobs:` configuration. The top-level `safe-jobs:` key is deprecated and not supported.

### Issue Creation (`create-issue:`)

Creates GitHub issues based on workflow output.
Expand Down
4 changes: 0 additions & 4 deletions pkg/workflow/frontmatter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ type FrontmatterConfig struct {
Runtimes map[string]any `json:"runtimes,omitempty"` // Deprecated: use RuntimesTyped
Jobs map[string]any `json:"jobs,omitempty"` // Custom workflow jobs (too dynamic to type)
SafeOutputs *SafeOutputsConfig `json:"safe-outputs,omitempty"`
SafeJobs map[string]any `json:"safe-jobs,omitempty"` // Deprecated, use SafeOutputs.Jobs
SafeInputs *SafeInputsConfig `json:"safe-inputs,omitempty"`
PermissionsTyped *PermissionsConfig `json:"-"` // New typed field (not in JSON to avoid conflict)

Expand Down Expand Up @@ -435,9 +434,6 @@ func (fc *FrontmatterConfig) ToMap() map[string]any {
// Convert SafeOutputsConfig to map - would need a ToMap method
result["safe-outputs"] = fc.SafeOutputs
}
if fc.SafeJobs != nil {
result["safe-jobs"] = fc.SafeJobs
}
if fc.SafeInputs != nil {
// Convert SafeInputsConfig to map - would need a ToMap method
result["safe-inputs"] = fc.SafeInputs
Expand Down
26 changes: 16 additions & 10 deletions pkg/workflow/frontmatter_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,14 @@ func TestParseFrontmatterConfig(t *testing.T) {

t.Run("preserves complex nested structures", func(t *testing.T) {
frontmatter := map[string]any{
"safe-jobs": map[string]any{
"custom-job": map[string]any{
"conditions": []any{
map[string]any{
"field": "status",
"value": "success",
"safe-outputs": map[string]any{
"jobs": map[string]any{
"custom-job": map[string]any{
"conditions": []any{
map[string]any{
"field": "status",
"value": "success",
},
},
},
},
Expand All @@ -331,13 +333,17 @@ func TestParseFrontmatterConfig(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}

if config.SafeJobs == nil {
t.Fatal("SafeJobs should not be nil")
if config.SafeOutputs == nil {
t.Fatal("SafeOutputs should not be nil")
}

if config.SafeOutputs.Jobs == nil {
t.Fatal("SafeOutputs.Jobs should not be nil")
}

customJob, ok := config.SafeJobs["custom-job"]
customJob, ok := config.SafeOutputs.Jobs["custom-job"]
if !ok {
t.Fatal("custom-job should exist")
t.Fatal("custom-job should exist in SafeOutputs.Jobs")
}

if customJob == nil {
Expand Down
1 change: 0 additions & 1 deletion skills/developer/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,6 @@ All three JSON schema files enforce strict validation with `"additionalPropertie
| File | Purpose |
|------|---------|
| `pkg/parser/schemas/main_workflow_schema.json` | Validates agentic workflow frontmatter in `.github/workflows/*.md` files |
| `pkg/parser/schemas/included_file_schema.json` | Validates imported/included workflow files |
| `pkg/parser/schemas/mcp_config_schema.json` | Validates MCP (Model Context Protocol) server configuration |

### How It Works
Expand Down
21 changes: 6 additions & 15 deletions specs/schema-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

All three JSON schema files in this repository enforce strict validation by having `"additionalProperties": false` at the root level, which prevents typos and undefined fields from silently passing validation.
Both JSON schema files in this repository enforce strict validation by having `"additionalProperties": false` at the root level, which prevents typos and undefined fields from silently passing validation.

## Schema Files

Expand All @@ -11,12 +11,7 @@ All three JSON schema files in this repository enforce strict validation by havi
- **Root property**: `"additionalProperties": false` (line 3002)
- **Purpose**: Validates agentic workflow frontmatter in `.github/workflows/*.md` files

### 2. Included File Schema
- **File**: `pkg/parser/schemas/included_file_schema.json`
- **Root property**: `"additionalProperties": false` (line 426)
- **Purpose**: Validates imported/included workflow files

### 3. MCP Config Schema
### 2. MCP Config Schema
- **File**: `pkg/parser/schemas/mcp_config_schema.json`
- **Root property**: `"additionalProperties": false` (line 99)
- **Purpose**: Validates MCP (Model Context Protocol) server configuration
Expand All @@ -37,11 +32,10 @@ When `"additionalProperties": false` is set at the root level of a JSON schema,

Comprehensive test coverage is provided in:
- **File**: `pkg/parser/schema_additional_properties_test.go`
- **Test cases**: 16 total
- 8 tests for common typos in main workflow schema
- 3 tests for typos in included file schema
- 3 tests for typos in MCP config schema
- 2 tests to verify valid properties are still accepted
- **Test cases**: Tests for common typos and validation
- Tests for common typos in main workflow schema
- Tests for typos in MCP config schema
- Tests to verify valid properties are still accepted

Run tests with:
```bash
Expand Down Expand Up @@ -88,9 +82,6 @@ The schemas are embedded in the Go binary using `//go:embed` directives in `pkg/
//go:embed schemas/main_workflow_schema.json
var mainWorkflowSchema string

//go:embed schemas/included_file_schema.json
var includedFileSchema string

//go:embed schemas/mcp_config_schema.json
var mcpConfigSchema string
```text
Expand Down
Loading