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
5 changes: 3 additions & 2 deletions .github/workflows/security-alert-burndown.lock.yml

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

5 changes: 3 additions & 2 deletions .github/workflows/security-guard.lock.yml

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

51 changes: 51 additions & 0 deletions pkg/parser/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,57 @@ func TestValidateMainWorkflowFrontmatterWithSchema(t *testing.T) {
wantErr: true,
errContains: "additional properties",
},
{
name: "invalid name too long (257 chars)",
frontmatter: map[string]any{
"on": "workflow_dispatch",
"name": strings.Repeat("a", 257),
},
wantErr: true,
errContains: "maxLength",
},
{
name: "valid name at max length (256 chars)",
frontmatter: map[string]any{
"on": "workflow_dispatch",
"name": strings.Repeat("a", 256),
},
wantErr: false,
},
{
name: "invalid description too long (10001 chars)",
frontmatter: map[string]any{
"on": "workflow_dispatch",
"description": strings.Repeat("a", 10001),
},
wantErr: true,
errContains: "maxLength",
},
{
name: "valid description at max length (10000 chars)",
frontmatter: map[string]any{
"on": "workflow_dispatch",
"description": strings.Repeat("a", 10000),
},
wantErr: false,
},
{
name: "invalid tracker-id too long (129 chars)",
frontmatter: map[string]any{
"on": "workflow_dispatch",
"tracker-id": strings.Repeat("a", 129),
},
wantErr: true,
errContains: "maxLength",
},
{
name: "valid tracker-id at max length (128 chars)",
frontmatter: map[string]any{
"on": "workflow_dispatch",
"tracker-id": strings.Repeat("a", 128),
},
wantErr: false,
},
}

for _, tt := range tests {
Expand Down
3 changes: 3 additions & 0 deletions pkg/parser/schemas/main_workflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"description": "Workflow name that appears in the GitHub Actions interface. If not specified, defaults to the filename without extension.",
"examples": ["Copilot Agent PR Analysis", "Dev Hawk", "Smoke Claude"]
},
"description": {
"type": "string",
"maxLength": 10000,
"description": "Optional workflow description that is rendered as a comment in the generated GitHub Actions YAML file (.lock.yml)",
"examples": ["Quickstart for using the GitHub Actions library"]
},
Expand All @@ -26,6 +28,7 @@
"tracker-id": {
"type": "string",
"minLength": 8,
"maxLength": 128,
"pattern": "^[a-zA-Z0-9_-]+$",
"description": "Optional tracker identifier to tag all created assets (issues, discussions, comments, pull requests). Must be at least 8 characters and contain only alphanumeric characters, hyphens, and underscores. This identifier will be inserted in the body/description of all created assets to enable searching and retrieving assets associated with this workflow.",
"examples": ["workflow-2024-q1", "team-alpha-bot", "security_audit_v2"]
Expand Down
Loading
Loading