-
Notifications
You must be signed in to change notification settings - Fork 317
[plan] Parameterize network.allowed and network.blocked to accept GitHub Actions expressions #23840
Description
Objective
Allow the network.allowed (and network.blocked) frontmatter fields to accept GitHub Actions expression strings (e.g. ${{ inputs.allowed-domains }}) as list items or as the full list value, enabling reusable workflows to customize network policy at call time.
Context
Tracked in issue #23724. Currently blocked by JSON schema type constraints (expects array, gets string). The Go extraction code in pkg/workflow/engine.go also does strict type assertions on []string.
Current Behavior
network:
allowed:
- github.com
- npm # Only literal domain/ecosystem strings workExpected Behavior
network:
allowed:
- github.com
- ${{ inputs.extra-domain }} # ✅ Expression for individual itemOr potentially:
network:
allowed: ${{ inputs.allowed-domains }} # ✅ Expression for entire listApproach
-
Decide on granularity (recommend per-item approach for schema simplicity):
- Per-item: array items accept
string(existing behavior) or an expression${{ ... }} - Full-list expression: the
allowedfield accepts an array OR a single expression string
- Per-item: array items accept
-
Update JSON schema in
pkg/parser/schemas/main_workflow_schema.json:- For the per-item approach:
items: { oneOf: [domain-string, expression-string] } - Or relax the item pattern to also accept
${{ ... }}strings.
- For the per-item approach:
-
Update
NetworkPermissionsparsing inpkg/workflow/engine.go(extractNetworkPermissionsor similar):- When iterating
network.alloweditems, check if the item is a${{ ... }}expression and pass it through as-is to the compiled YAML. - At compile time, validate non-expression items as domains/ecosystems; skip validation for expression items.
- When iterating
-
Update compiler output: Ensure expression items emit correctly in the compiled
.lock.yml(GitHub Actions evaluates them at runtime). -
Update tests to cover expression items alongside literal domains.
Files to Modify
pkg/parser/schemas/main_workflow_schema.json— relax item type constraintpkg/workflow/engine.go—NetworkPermissionsextraction to handle expression itemspkg/workflow/compilation code emitting theallowedlist- Tests in
pkg/workflow/orpkg/parser/
Acceptance Criteria
-
network.allowed: [github.com, npm]still works (backward compatible) -
network.allowed: [${{ inputs.domain }}, github.com]compiles and expressions appear correctly in the compiled.lock.yml - Non-expression strings that aren't valid domains/ecosystems still produce validation errors
- Tests pass:
make agent-finish
Related to Ask: Runtime Parameterization of Compile-Time Frontmatter Fields #23724
Generated by Plan Command for issue #23724 · ◷
- expires on Apr 3, 2026, 5:44 AM UTC