feat: support uses/with import syntax and import-schema validation with object and array types#23192
feat: support uses/with import syntax and import-schema validation with object and array types#23192
uses/with import syntax and import-schema validation with object and array types#23192Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/fb37a409-f510-46bc-92af-4af5823c2c42 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/fb37a409-f510-46bc-92af-4af5823c2c42 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
uses/with import syntax and import-schema validation
|
@copilot allow one level deep object definitions in import-schema It should be enough to recreate the qmd configuration data |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/32fe5daa-b76d-433b-8bac-6b8318f7d59a Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 8714dad. import-schema:
config:
type: object
properties:
apiKey:
type: string
required: true
timeout:
type: number
default: 30Sub-fields are validated (unknown keys, required checks, scalar type matching) and accessible via Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
uses/with import syntax and import-schema validationuses/with import syntax and import-schema validation with object types
|
@copilot create a shared agentic workflow that uses import-schema and inputs to reimplement the "serena" tool support.
|
…-schema
- Add `type: array` with optional `items` validation to import-schema
- Apply expression substitution to imported workflow frontmatter before processing,
enabling `tools.serena: ${{ github.aw.import-inputs.languages }}` patterns
- Serialize arrays as JSON when substituting into raw content (valid YAML inline)
- Add `import-schema` to allowed fields list for shared workflow frontmatter
- Suppress schema validation warnings for shared files with unsubstituted expressions
- Create `.github/workflows/shared/mcp/serena.md` using import-schema with languages array
- Add TestImportSchemaArrayType with 4 sub-tests covering valid/invalid array inputs
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/bc90492b-01ba-40ad-a7e2-d311ab30a41c
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 242029a. Here's what was added:
import-schema:
languages:
type: array
items:
type: string
required: trueArray items are validated element-by-element. Arrays serialize as JSON ( Frontmatter expression substitution: New # Importing workflow
imports:
- uses: shared/mcp/serena.md
with:
languages: ["go", "typescript"]The shared workflow declares Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
uses/with import syntax and import-schema validation with object typesuses/with import syntax and import-schema validation with object and array types
|
@copilot reimplement the Serena tool functionality in the Serena.md workflows WITHOUT using tools.serena |
Imports currently only accept a string path or
{path, inputs}object. This adds auses/withform (mirroring GitHub Actions reusable workflow syntax), a top-levelimport-schemafield for declaring and validating those inputs, and new expressions for accessing them.New syntax
New: Parameterized Serena shared workflow
A new
shared/mcp/serena.mdworkflow usesimport-schemato accept alanguagesarray and dynamically configuretools.serena:Changes
pkg/parser/import_bfs.go—parseImportSpecsFromArraynow acceptsusesas alias forpathandwithas alias forinputspkg/parser/import_field_extractor.go— validateswithvalues against the imported workflow'simport-schema: required fields, unknown keys, type matching (string,number,boolean,choice,object,array), choice membership, object sub-property validation, and per-element array item type validation; addssubstituteImportInputsInContentto apply expression substitution to raw imported file content (including YAML frontmatter) before parsingpkg/parser/include_processor.go— addsimport-schemato the allowed fields list for shared workflow frontmatter; suppresses schema validation warnings for shared files containing unsubstituted${{ }}expressions (resolved at import time)pkg/parser/schemas/main_workflow_schema.json— addsimport-schematop-level property supporting scalar, object, and array types; extends import itemoneOfwithuses/withobject form; allows object and array values inwithpkg/workflow/frontmatter_types.go— addsImportSchema map[string]anyfield toFrontmatterConfigpkg/workflow/expression_patterns.go— addsAWImportInputsPattern/AWImportInputsExpressionPatternforgithub.aw.import-inputs.*and dotted paths (github.aw.import-inputs.<key>.<subkey>)pkg/workflow/expression_extraction.go—SubstituteImportInputshandlesgithub.aw.inputs.*(legacy),github.aw.import-inputs.<key>(scalar/array), andgithub.aw.import-inputs.<key>.<subkey>(object sub-field); addsresolveImportInputPathfor dotted-path lookup; arrays and maps serialize as JSON (valid YAML inline syntax) viamarshalImportInputValuepkg/workflow/expression_safety_validation.go— permitsgithub.aw.import-inputs.*and dotted forms through expression safety checks.github/workflows/shared/mcp/serena.md— new parameterized shared workflow usingimport-schemawithlanguages: {type: array}that dynamically setstools.serenabased on the provided language listBackward compatibility is preserved: imports without
import-schemaaccept anywith/inputsvalues unchanged.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.