Skip to content

Commit 0aef8dc

Browse files
docs: add variable-groups field to README table and site front-matter reference (#1434)
Add the variable-groups: front-matter field (introduced in #1426) to the human-facing docs: - README.md front matter fields table: new row after repos: - site/src/content/docs/reference/front-matter.mdx: - Overview YAML block: add variable-groups: commented entry after repos: - New ## Variable Groups section (authorization, names-only, target support) Verified: cd site && npm run build:astro — 38 pages, all internal links valid. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent db56311 commit 0aef8dc

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ the service connections. Approve the permissions and the pipeline is ready.
259259
| `pool` | string or object | `vmImage: ubuntu-22.04` (standalone) / `AZS-1ES-L-MMS-ubuntu-22.04` (1ES) | Agent pool |
260260
| `workspace` | `root` \| `repo` \| `self` \| *alias* | auto | Working directory mode. `self` is an alias for `repo`; any checked-out repo alias is also accepted. |
261261
| `repos` | list | — | Compact repository declarations (replaces legacy `repositories:` + `checkout:`) |
262+
| `variable-groups` | list | — | ADO Library variable group names to import (emits `variables: - group: <name>` in the lock). Not supported on `target: job` or `target: stage`. |
262263
| `mcp-servers` | map | — | MCP server configuration |
263264
| `tools` | object | — | Tool configuration (`bash`, `edit`, `cache-memory`, `azure-devops`) |
264265
| `runtimes` | object | — | Runtime environment configuration (`lean`, `python`, `node`, `dotnet`) |

site/src/content/docs/reference/front-matter.mdx

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ repos: # compact repository declarations (replaces rep
3232
- name: my-org/templates # object form for full control
3333
ref: refs/heads/release/2.x
3434
checkout: false # declared as resource only, not checked out by the agent
35+
variable-groups: # optional: import ADO Library variable groups into the pipeline
36+
- Agentic Workflows # group display names only — secrets referenced by $(VAR_NAME) in steps
3537
tools: # optional tool configuration
3638
bash: ["cat", "ls", "grep"] # explicit bash allow-list; when omitted, all bash tools are allowed (unrestricted)
3739
edit: true # enable file editing tool (default: true)
@@ -443,6 +445,81 @@ becomes a `repos:` entry, with `checkout: false` added for entries
443445
that weren't listed under `checkout:`. Mixing the legacy fields with
444446
an existing `repos:` block is rejected; pick one shape.
445447

448+
## Variable Groups (`variable-groups:`)
449+
450+
Import one or more Azure DevOps **variable groups** (ADO Library groups) into
451+
the generated pipeline so a source-clean lock can reference secrets managed at
452+
the project level — for example a GitHub App private key shared across many
453+
pipelines:
454+
455+
```yaml
456+
variable-groups:
457+
- Agentic Workflows
458+
- Shared Secrets
459+
```
460+
461+
Each entry is the **display name** of a variable group. The compiler emits a
462+
top-level `variables:` block with one `- group:` import per entry, preserving
463+
declaration order:
464+
465+
```yaml
466+
variables:
467+
- group: Agentic Workflows
468+
- group: Shared Secrets
469+
```
470+
471+
Groups are merged in order when they define the same variable name — later
472+
groups win on key collisions.
473+
474+
### Authorization and import are both required
475+
476+
In Azure DevOps two independent steps are needed before a group's variables
477+
are available to a YAML pipeline run:
478+
479+
1. **Authorization** — the pipeline *definition* must be granted permission
480+
to use the group (done in the ADO Library UI, outside ado-aw).
481+
2. **YAML import** — the pipeline *YAML* must explicitly pull the group in
482+
with `variables: - group: <name>`.
483+
484+
Authorization alone is not sufficient — without the YAML import the variables
485+
are unavailable at runtime. `variable-groups:` provides the YAML import; you
486+
still need to authorize the group on the pipeline definition itself.
487+
488+
### Names only — never values
489+
490+
Only group **names** belong in `variable-groups:`. ado-aw never resolves,
491+
prints, logs, or serializes a group's variable values. Steps reference secrets
492+
by macro (`$(VAR_NAME)`) exactly as before. For example, wiring a GitHub App
493+
private key that lives inside a group:
494+
495+
```yaml
496+
variable-groups:
497+
- Agentic Workflows
498+
engine:
499+
id: copilot
500+
github-app-token:
501+
app-id: 1234567
502+
owner: octo-org
503+
private-key: AGENTIC_WORKFLOWS_GITHUB_APP_PRIVATE_KEY
504+
```
505+
506+
Group names that contain ADO expressions (`${{`, `$(`, `$[`), pipeline
507+
commands (`##vso[`, `##[`), the compiler's own template marker (`{{`), or
508+
control characters are rejected at compile time. Leading or trailing whitespace
509+
is also rejected — the name must match the ADO group display name exactly.
510+
511+
Duplicate entries are rejected. Variable group names are case-insensitive in
512+
ADO, so `Shared Secrets` and `shared secrets` are treated as the same group;
513+
remove the redundant entry.
514+
515+
### Target support
516+
517+
`variable-groups:` is only valid for pipeline-level targets — `standalone`
518+
(default) and `1es`. Using it on `target: job` or `target: stage` is a
519+
compile-time error: ADO job and stage templates cannot declare pipeline-level
520+
`variables:` (the parent pipeline that includes the template owns them). Import
521+
the group in that parent pipeline instead.
522+
446523
## Custom Steps Injection
447524

448525
The `steps`, `post-steps`, `setup`, and `teardown` fields let you inject custom ADO pipeline steps at specific points in the compiled workflow's execution flow.

0 commit comments

Comments
 (0)