From 010ecb2b3482d53393a7290c2fa06749c6b1a02e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 11 Mar 2026 23:55:30 +0000 Subject: [PATCH] Sync github-agentic-workflows.md with v0.40.1 Document compile-time warnings for push-to-pull-request-branch with target: "*" and add the checkout fetch: field that was missing. Co-Authored-By: Claude Sonnet 4.6 --- .github/aw/github-agentic-workflows.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/aw/github-agentic-workflows.md b/.github/aw/github-agentic-workflows.md index b94643f924a..d3d9cecb019 100644 --- a/.github/aw/github-agentic-workflows.md +++ b/.github/aw/github-agentic-workflows.md @@ -284,6 +284,11 @@ The YAML frontmatter supports these fields: - `ref:` - Branch, tag, or SHA to check out (defaults to triggering ref) - `path:` - Relative path within `GITHUB_WORKSPACE` (defaults to workspace root) - `fetch-depth:` - Number of commits to fetch; `0` = full history, `1` = shallow (default) + - `fetch:` - Additional Git refs to fetch after checkout (array of patterns) + - `"*"` - fetch all remote branches + - `"refs/pulls/open/*"` - all open pull-request refs + - Branch names, glob patterns (e.g., `"feature/*"`) + - Example: `fetch: ["*"]`, `fetch: ["refs/pulls/open/*"]` - `sparse-checkout:` - Newline-separated glob patterns for sparse checkout - `submodules:` - Submodule handling: `"recursive"`, `"true"`, or `"false"` - `lfs:` - Download Git LFS objects (boolean, default: `false`) @@ -788,6 +793,22 @@ The YAML frontmatter supports these fields: github-token-for-extra-empty-commit: ${{ secrets.MY_CI_PAT }} # Optional: PAT or "app" to trigger CI on pushed commits ``` Not supported for cross-repository operations. To trigger CI on pushed commits, use `github-token-for-extra-empty-commit` or set the magic secret `GH_AW_CI_TRIGGER_TOKEN`. + + **Compile-time warnings for `target: "*"`**: When `target: "*"` is set, the compiler emits warnings if: + 1. The checkout configuration does not include a wildcard fetch pattern — add `fetch: ["*"]` with `fetch-depth: 0` so the agent can access all PR branches at runtime + 2. No constraints are provided — add `title-prefix` or `labels` to restrict which PRs can receive pushes + + Example with all recommended settings: + ```yaml + checkout: + fetch: ["*"] + fetch-depth: 0 + safe-outputs: + push-to-pull-request-branch: + target: "*" + title-prefix: "[bot] " # restrict to PRs with this title prefix + labels: [automated] # restrict to PRs carrying all these labels + ``` - `update-discussion:` - Update discussion title, body, or labels ```yaml safe-outputs: