Skip to content

[Bug] protected-files object form fails compilation despite being documented #28315

@edgeq

Description

@edgeq

Summary

The protected-files field under create-pull-request safe-outputs is documented as supporting an object form with policy and exclude, but gh aw compile rejects it with a schema validation error.

Steps to reproduce

  1. Add the following to a workflow's frontmatter:
safe-outputs:
  create-pull-request:
    title-prefix: "[docs] "
    protected-files:
      policy: fallback-to-issue
      exclude:
        - .claude/
        - .github/instructions/
    allowed-files:
      - README.md
      - CLAUDE.md
  1. Run gh aw compile

Expected behavior

Compilation succeeds, with .claude/ and .github/instructions/ excluded from the protected set per the documented object-form syntax.

Actual behavior

.github/workflows/docs-sync.md:25:23: error: expected string or null, got object.
Expected format: {"footer":true,"preserve-branch-name":true,"reviewers":null}

The compiler only accepts string values (blocked, fallback-to-issue, allowed) or null for protected-files.

Documentation reference

The safe-outputs pull requests reference shows this as a valid configuration:

safe-outputs:
  create-pull-request:
    protected-files:
      policy: fallback-to-issue
      exclude:
        - AGENTS.md
        - .agents/

Use case

We have a documentation sync workflow that needs to update files under .claude/rules/ and .github/instructions/. Both paths fall under default protected path prefixes (.claude/ and .github/). Using protected-files: allowed is the current workaround, but it's broader than intended and often raises permission-denied errors — we'd prefer to exclude only the specific prefixes the agent needs to write to and not get denied permissions.

Environment

gh aw version

(CLI was updated via gh aw update on 2026-04-24)

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions