diff --git a/docs/src/content/docs/reference/cross-repository.md b/docs/src/content/docs/reference/cross-repository.md index fa4f7f20b2..d56df7d985 100644 --- a/docs/src/content/docs/reference/cross-repository.md +++ b/docs/src/content/docs/reference/cross-repository.md @@ -178,6 +178,24 @@ safe-outputs: Without `target-repo`, safe outputs operate on the repository where the workflow is running. +### Wildcard Target Repository (`target-repo: "*"`) + +Set `target-repo: "*"` to allow the agent to dynamically target any repository at runtime. When configured, the agent receives a `repo` parameter in its tool call where it supplies the target repository in `owner/repo` format: + +```yaml wrap +safe-outputs: + github-token: ${{ secrets.CROSS_REPO_PAT }} + create-issue: + target-repo: "*" + title-prefix: "[component] " +``` + +Use this when the target repository is not known at workflow authoring time — for example, when building a workflow that routes issues to different repositories based on labels or content. + +:::caution +The following safe-output types do **not** support `target-repo: "*"`: `create-pull-request-review-comment`, `reply-to-pull-request-review-comment`, `submit-pull-request-review`, `create-agent-session`, and `manage-project-items`. Use an explicit `owner/repo` value or `allowed-repos` for these types. +::: + ### Allowed Repositories (`allowed-repos`) Allow the agent to dynamically select from multiple repositories: diff --git a/docs/src/content/docs/reference/safe-outputs.md b/docs/src/content/docs/reference/safe-outputs.md index 9c7dfd2e10..26b4184c16 100644 --- a/docs/src/content/docs/reference/safe-outputs.md +++ b/docs/src/content/docs/reference/safe-outputs.md @@ -1343,10 +1343,12 @@ safe-outputs: Most safe outputs support cross-repository operations: -- **`target-repo`**: Set a default target repository for all operations of this type -- **`allowed-repos`**: Allow the agent to dynamically choose which repository to target (from an allowlist) +- **`target-repo`**: Set a fixed target repository (`owner/repo` format), or use `"*"` as a wildcard to let the agent supply any repository at runtime. +- **`allowed-repos`**: Allow the agent to dynamically choose from an allowlist of repositories (supports glob patterns, e.g. `org/*`). -See [Cross-Repository Operations](/gh-aw/reference/cross-repository/) technical details. +Using `target-repo: "*"` enables fully dynamic routing — the agent provides the `repo` field in each tool call. Note that `create-pull-request-review-comment`, `reply-to-pull-request-review-comment`, `submit-pull-request-review`, `create-agent-session`, and `manage-project-items` do not support the wildcard; use an explicit repository or `allowed-repos` for those types. + +See [Cross-Repository Operations](/gh-aw/reference/cross-repository/) for comprehensive documentation. ## Global Configuration Options