Skip to content

Commit 4fce5dd

Browse files
docs(site): document safe-outputs key validation errors (#729)
1 parent 2b2eb7d commit 4fce5dd

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

site/src/content/docs/reference/safe-outputs.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ safe-outputs:
3232
3333
Safe output configurations are passed to Stage 3 execution and used when processing safe outputs.
3434
35+
:::caution[Compile-time key validation]
36+
All keys under `safe-outputs:` must match an exact registered tool name (e.g. `create-pull-request`, not `create-pr`). The compiler rejects unknown or misspelled keys with an error listing similar known tools. Key names must use only ASCII letters, digits, and hyphens.
37+
:::
38+
3539
## Available Safe Output Tools
3640

3741
### comment-on-work-item

site/src/content/docs/troubleshooting/common-issues.mdx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,51 @@ permissions:
5454
5555
If you haven't created a service connection yet, see the [Service Connections guide](/ado-aw/setup/service-connections/).
5656
57+
### "safe-outputs contains unrecognised tool name(s)"
58+
59+
A key under `safe-outputs:` does not match any known tool name. The compiler now rejects unknown keys rather than silently dropping them.
60+
61+
```
62+
safe-outputs contains unrecognised tool name(s):
63+
- create-pr (similar known tools: create-branch, create-git-tag, create-pull-request, create-wiki-page, create-work-item)
64+
65+
Valid safe-output keys are listed in docs/safe-outputs.md. Each key must
66+
match exactly the kebab-case name registered by a tool in src/safeoutputs/
67+
(e.g. `create-pull-request`, not `create-pr`).
68+
```
69+
70+
**Solution:** Replace the unrecognised key with the correct tool name shown in the "similar known tools" hint. All tool names use kebab-case and must match exactly:
71+
72+
```yaml
73+
# ✗ Bad — old short-form that used to be silently dropped
74+
safe-outputs:
75+
create-pr:
76+
target-branch: main
77+
78+
# ✓ Good — exact registered name
79+
safe-outputs:
80+
create-pull-request:
81+
target-branch: main
82+
```
83+
84+
See the [Safe Outputs reference](/ado-aw/reference/safe-outputs/) for the full list of available tool names.
85+
86+
### "safe-outputs contains tool name(s) with invalid characters"
87+
88+
A key under `safe-outputs:` contains characters other than ASCII letters, digits, and hyphens.
89+
90+
**Solution:** Use only lowercase letters, digits, and hyphens in `safe-outputs:` keys:
91+
92+
```yaml
93+
# ✗ Bad — spaces are not allowed
94+
safe-outputs:
95+
create work item: {}
96+
97+
# ✓ Good
98+
safe-outputs:
99+
create-work-item: {}
100+
```
101+
57102
### "safe-outputs.comment-on-work-item requires a 'target' field"
58103
59104
Certain safe-output tools require an explicit `target:` in the front matter configuration. `comment-on-work-item` and `update-work-item` are the most common examples — they need `target:` to scope which work items can be modified.

0 commit comments

Comments
 (0)