Skip to content

Commit f934651

Browse files
EvangelinkCopilot
andauthored
Update agentic workflows to gh-aw v1.2.2 (#12559)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4f367c4 commit f934651

50 files changed

Lines changed: 11034 additions & 4086 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/agents/agentic-workflows.md‎

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@ disable-model-invocation: true
88

99
This agent helps you work with **GitHub Agentic Workflows (gh-aw)**, a CLI extension for creating AI-powered workflows in natural language using markdown files.
1010

11+
For debugging, incident, health, and failure-related optimization requests, first
12+
load `.github/aw/debug-bootstrap.md` from the guidance repository/ref and follow
13+
its intent routing, even when the CLI is installed. This takes precedence over
14+
generic update, upgrade, or optimization routes. Preserve that guidance ref for
15+
all debugging links and public raw fallbacks; URLs showing `main` below are
16+
defaults only when no guidance revision is supplied. Reuse already-loaded guides.
17+
The intent index is `.github/aw/debug-scenarios.md`; load only the selected
18+
specialized route, not every debugging reference.
19+
1120
## Repository Instructions Overlay
1221

13-
If `.github/aw/instructions.md` exists, load it with:
14-
@.github/aw/instructions.md
22+
Load the target repository's `.github/aw/instructions.md`, if present.
23+
Use `@.github/aw/instructions.md` only in a matching checkout; do not substitute
24+
a guidance-repository overlay.
1525

1626
Precedence: repository overlay instructions override defaults in this agent when they conflict.
1727

@@ -21,7 +31,8 @@ This is a **dispatcher agent** that routes your request to the appropriate speci
2131

2232
- **Creating new workflows**: Routes to `create` prompt
2333
- **Updating existing workflows**: Routes to `update` prompt
24-
- **Debugging workflows**: Routes to `debug` prompt
34+
- **Diagnosis, patching, and active debugging**: Routes to `debug-agentic-workflow` for the local-first strategy, evidence triage and live gates
35+
- **Repository-wide debugging or run analysis**: Routes to `analyzing-runs` for existing-run failure clustering before selecting a workflow; supplied run/failure scope takes precedence
2536
- **Upgrading workflows**: Routes to `upgrade-agentic-workflows` prompt
2637
- **Creating report-generating workflows**: Routes to `report` prompt — consult this whenever the workflow posts status updates, audits, analyses, or any structured output as issues, discussions, or comments
2738
- **Creating shared components**: Routes to `create-shared-agentic-workflow` prompt
@@ -31,6 +42,8 @@ This is a **dispatcher agent** that routes your request to the appropriate speci
3142
- **CLI commands and triggering workflows**: Routes to `cli-commands` guide — consult this whenever the user asks how to run, compile, debug, or manage workflows from the command line, or when they need the MCP tool equivalent of a `gh aw` command
3243
- **Reducing token consumption / cost optimization**: Routes to `token-optimization` guide — consult this whenever the user asks how to reduce token usage, lower costs, speed up workflows, or measure the impact of prompt changes with experiments
3344
- **Choosing workflow architectures and design patterns**: Routes to `patterns` guide — consult this whenever the user asks for strategy, architecture, operating models, or pattern selection for agentic workflows
45+
- **Git-backed work queues**: Routes to `work-queue` instructions for producers, dispatchers, workers, observers, deployment and recovery
46+
- **Local SDLC issue bootstrap**: Follow `.github/aw/squad.md`.
3447

3548
Workflows may optionally include:
3649

@@ -47,7 +60,8 @@ Workflows may optionally include:
4760
## Problems This Solves
4861

4962
- **Workflow Creation**: Design secure, validated agentic workflows with proper triggers, tools, and permissions
50-
- **Workflow Debugging**: Analyze logs, identify missing tools, investigate failures, and fix configuration issues
63+
- **Diagnosis and Patching**: Analyze evidence and produce regression-backed fixes without requiring live runs
64+
- **Active Debugging**: Run bounded edit/test/run/audit loops where permitted, stopping on dispatch 403 responses
5165
- **Version Upgrades**: Migrate workflows to new gh-aw versions, apply codemods, fix breaking changes
5266
- **Component Design**: Create reusable shared workflow components that wrap MCP servers
5367

@@ -61,7 +75,9 @@ When you interact with this agent, it will:
6175

6276
## Available Prompts
6377

64-
> **Note**: The prompt and reference files listed below are located in the [`github/gh-aw`](https://github.com/github/gh-aw) repository and are **not available locally** in this repository. Load them from their public URLs.
78+
> **Note**: The prompt and reference files below are from [`github/gh-aw`](https://github.com/github/gh-aw). Use a local guidance checkout only when its repository/ref matches the requested guidance; otherwise load their public URLs at the resolved guidance ref.
79+
80+
If GitHub API, `gh api`, or GitHub MCP downloads return HTTP 403 (including a token SAML-authorized for a different organization), do not retry with the same token. Fetch the public file without authentication from `https://raw.githubusercontent.com/github/gh-aw/main/<path>` instead, preserving its repository-relative path (including `.github/`). For example: `curl --fail --silent --show-error --location 'https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/create-agentic-workflow.md'`. Use the same fallback for referenced instructions and `SKILL.md` files; never send an Authorization header or token to the raw URL. If the public download fails, report that error rather than proceeding without the required instructions. This fallback is for public `github/gh-aw` content only, not private or enterprise repositories.
6581

6682
### Create New Workflow
6783
**Load when**: User wants to create a new workflow from scratch, add automation, or design a workflow that doesn't exist yet
@@ -83,16 +99,32 @@ When you interact with this agent, it will:
8399
- "Update the PR reviewer to use discussions instead of issues"
84100
- "Improve the prompt for the weekly-research workflow"
85101

86-
### Debug Workflow
102+
### Diagnose, Patch, or Debug a Workflow
87103
**Load when**: User needs to investigate, audit, debug, or understand a workflow, troubleshoot issues, analyze logs, or fix errors
88104

89105
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/debug-agentic-workflow.md`
90106

107+
The shared strategy distinguishes diagnosis/patching from permitted active debug
108+
loops using explicit live gates and includes existing-run evidence triage.
109+
For CLI setup or run-URL scoping in a fresh session, first load
110+
`https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/debug-bootstrap.md`; it bootstraps
111+
this same strategy rather than a separate debug procedure.
112+
91113
**Use cases**:
92114
- "Why is this workflow failing?"
93115
- "Analyze the logs for workflow X"
94116
- "Investigate missing tool calls in run #12345"
95117

118+
### Analyze Existing Runs or Repository-Wide Failures
119+
**Load when**: User asks to debug or optimize agentic workflows generally, without a specific run/failure scope
120+
121+
**Prompt file**: `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/analyzing-runs.md`
122+
123+
Start with repository-wide existing-run failure clustering, not an arbitrary
124+
workflow or a request to pick one. Supplied workflow/run/failure scope takes
125+
precedence. Use the shared debugging strategy for subsequent fixes; never
126+
dispatch workflows to obtain evidence.
127+
96128
### Upgrade Agentic Workflows
97129
**Load when**: User wants to upgrade workflows to a new gh-aw version or fix deprecations
98130

@@ -180,6 +212,15 @@ When you interact with this agent, it will:
180212

181213
## Instructions
182214

215+
### Work Queue
216+
217+
For queue design, deployment, inspection or recovery, load
218+
`https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/work-queue.md`.
219+
Also load it after the primary create/update/debug/upgrade prompt whenever a
220+
workflow uses `tools.work-queue`. Load linked developer docs and specifications
221+
only when needed; do not substitute lightweight WorkQueueOps backlog guidance
222+
for the Git-backed protocol.
223+
183224
When a user interacts with you:
184225

185226
1. **Identify the task type** from the user's request
@@ -196,13 +237,13 @@ gh aw init
196237
# Generate the lock file for a workflow
197238
gh aw compile [workflow-name]
198239

199-
# Trigger a workflow on demand (preferred over gh workflow run)
200-
gh aw run <workflow-name> # interactive input collection
201-
gh aw run <workflow-name> --ref main # run on a specific branch
240+
# Only where permitted and human-validated under debug-agentic-workflow.md:
241+
gh aw run <workflow-name> --ref REVIEWED_REF
202242

203243
# Debug workflow runs
204-
gh aw logs [workflow-name]
205-
gh aw audit <run-id>
244+
gh aw logs [workflow-name] --repo HOST/OWNER/REPO
245+
gh aw audit <run-url> # preserve host/repository and any job/step scope
246+
gh aw compile <workflow-name> --dry-run # first test of workflow changes
206247

207248
# Upgrade workflows
208249
gh aw fix --write
@@ -222,12 +263,12 @@ gh aw compile --validate
222263

223264
## Important Notes
224265

225-
- Always reference the instructions file at `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/github-agentic-workflows.md` for complete documentation
226-
- Use the MCP tool `agentic-workflows` when running in GitHub Copilot Cloud
266+
- For complete documentation, load `.github/aw/github-agentic-workflows.md` from the resolved guidance repository/ref.
267+
- Use gh-aw MCP tools only when exposed and authorized; otherwise use available CLI, cached evidence or static source through the CLI/MCP reference.
227268
- Workflows must be compiled to `.lock.yml` files before running in GitHub Actions
228269
- **Bash tools are enabled by default** - Don't restrict bash commands unnecessarily since workflows are sandboxed by the AWF
229270
- Follow security best practices: minimal permissions, explicit network access, no template injection
230271
- **Network configuration**: Use ecosystem identifiers (`node`, `python`, `go`, etc.) or explicit FQDNs in `network.allowed`. Bare shorthands like `npm` or `pypi` are **not** valid. See `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/network.md` for the full list of valid ecosystem identifiers and domain patterns.
231272
- **Single-file output**: When creating a workflow, produce exactly **one** workflow `.md` file. Do not create separate documentation files (architecture docs, runbooks, usage guides, etc.). If documentation is needed, add a brief `## Usage` section inside the workflow file itself.
232-
- **Triggering runs**: Always use `gh aw run <workflow-name>` to trigger a workflow on demand — not `gh workflow run <file>.lock.yml`. `gh aw run` handles workflow resolution by short name, input parsing and validation, and correct run-tracking for agentic workflows. Use `--ref <branch>` to run on a specific branch.
273+
- **Triggering runs**: Only where permitted and human-validated under `debug-agentic-workflow.md`, prefer `gh aw run <workflow-name>` over `gh workflow run <file>.lock.yml` for workflow resolution, input validation and run-tracking. Use the reviewed remote ref; explicit no-dispatch rules override user requests.
233274
- **CLI commands reference**: For a complete guide on all `gh aw` commands and their MCP tool equivalents (for restricted environments), see `https://raw.githubusercontent.com/github/gh-aw/main/.github/aw/cli-commands.md`

‎.github/aw/actions-lock.json‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@
5555
"version": "v4.39.3",
5656
"sha": "33d7b85da1a04171e211befe2c739303b9a4c066"
5757
},
58-
"github/gh-aw-actions/setup-cli@v1.0.1": {
58+
"github/gh-aw-actions/setup-cli@v1.2.2": {
5959
"repo": "github/gh-aw-actions/setup-cli",
60-
"version": "v1.0.1",
61-
"sha": "221ba4f4319de6b8e809d1a15528b3ae6a818aa5"
60+
"version": "v1.2.2",
61+
"sha": "53d0749e19424a918acd82b4d140264ce48f2f14"
6262
},
63-
"github/gh-aw-actions/setup@v1.0.1": {
63+
"github/gh-aw-actions/setup@v1.2.2": {
6464
"repo": "github/gh-aw-actions/setup",
65-
"version": "v1.0.1",
66-
"sha": "221ba4f4319de6b8e809d1a15528b3ae6a818aa5"
65+
"version": "v1.2.2",
66+
"sha": "53d0749e19424a918acd82b4d140264ce48f2f14"
6767
}
6868
},
6969
"containers": {
@@ -119,8 +119,8 @@
119119
},
120120
"ghcr.io/github/gh-aw-node": {
121121
"image": "ghcr.io/github/gh-aw-node",
122-
"digest": "sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f",
123-
"pinned_image": "ghcr.io/github/gh-aw-node@sha256:2c2ea524e648b91c8333ce246e3838fcf5b19ac70e45baac1a51b9207299749f"
122+
"digest": "sha256:8735428c2d4e602f90781ba0c571c400e8ff93c7ee1508a75d71f87e34e415cc",
123+
"pinned_image": "ghcr.io/github/gh-aw-node@sha256:8735428c2d4e602f90781ba0c571c400e8ff93c7ee1508a75d71f87e34e415cc"
124124
},
125125
"ghcr.io/github/github-mcp-server:v1.12.2": {
126126
"image": "ghcr.io/github/github-mcp-server:v1.12.2",

‎.github/scripts/test_agentic_workflow_warning_contracts.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ def test_dependabot_compiled_server_remains_read_only(self) -> None:
646646
script = gateway["run"]
647647
marker = '"github": '
648648
server, _ = json.JSONDecoder().raw_decode(script[script.index(marker) + len(marker):])
649-
self.assertEqual("ghcr.io/github/github-mcp-server:v2.0.3", server["container"])
649+
self.assertEqual("ghcr.io/github/github-mcp-server:v2.1.0", server["container"])
650650
self.assertEqual("1", server["env"]["GITHUB_READ_ONLY"])
651651
self.assertEqual("all,dependabot", server["env"]["GITHUB_TOOLSETS"])
652652
self.assertEqual("${GITHUB_MCP_SERVER_TOKEN}", server["env"]["GITHUB_PERSONAL_ACCESS_TOKEN"])

‎.github/scripts/test_gh_aw_firewall_footer.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_reapplying_correction_is_idempotent(self) -> None:
148148
def test_changed_upstream_module_fails_without_modifying_it(self) -> None:
149149
result = self.run_module(source=SOURCE + "\n// changed upstream module\n")
150150
self.assertEqual(
151-
"The gh-aw firewall footer module changed; revalidate or remove the v1.0.1 correction.",
151+
"The gh-aw firewall footer module changed; revalidate or remove the TCP_DENIED footer correction.",
152152
result["error"],
153153
)
154154
self.assertTrue(result["unchanged"])

‎.github/scripts/test_gh_aw_runtime_contracts.py‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
"""Offline contracts for the unchanged gh-aw-actions v1.0.1 setup/js runtime.
2+
"""Offline contracts for the pinned gh-aw-actions v1.2.2 setup/js runtime.
33
44
Run after security review:
55
python .github/scripts/test_gh_aw_runtime_contracts.py --actions-dir PATH -v
@@ -708,7 +708,7 @@ def test_centralized_review_number_is_delivered_to_each_compiled_prompt(self) ->
708708
shared, prompt = authored("shared/review-shared.md")
709709
self.assertEqual(PR_EXPRESSION, shared["env"]["REVIEW_PR_NUMBER"])
710710
self.assertIn("Review pull request #${{ env.REVIEW_PR_NUMBER }}", prompt)
711-
self.assertNotIn("fromJSON(", prompt) # Not allowed in v1.0.1 runtime-imported prompt text.
711+
self.assertNotIn("fromJSON(", prompt) # runtime_import.cjs isSafeExpression rejects it in imported prompt text.
712712
for index, name in enumerate(CONSUMERS):
713713
with self.subTest(case=f"consumer_{index}"):
714714
document = compiled(name)
@@ -720,15 +720,22 @@ def test_centralized_review_number_is_delivered_to_each_compiled_prompt(self) ->
720720
for title in ("Create prompt with built-in context", "Interpolate variables and render templates",
721721
"Substitute placeholders"):
722722
binding = step(document, "activation", "name", title)
723-
effective = {**activation_env, **binding.get("env", {})}
724-
self.assertEqual(PR_EXPRESSION, effective["REVIEW_PR_NUMBER"])
723+
# Actions evaluates a step's whole env map against the workflow/job env before
724+
# merging it, so this binding reads the workflow value even when gh-aw blanks the
725+
# raw REVIEW_PR_NUMBER name in the same map to isolate prompt rendering.
726+
self.assertEqual(PR_EXPRESSION, activation_env["REVIEW_PR_NUMBER"])
725727
self.assertEqual("${{ env.REVIEW_PR_NUMBER }}", binding["env"]["GH_AW_ENV_REVIEW_PR_NUMBER"])
728+
script = binding["with"]["script"]
729+
if "promptEnvironment" in script:
730+
allowlist = re.search(r"const promptEnvironment = new Set\((\[.*?\])\);", script)
731+
self.assertIsNotNone(allowlist, "unrecognized gh-aw prompt environment allowlist")
732+
self.assertIn("GH_AW_ENV_REVIEW_PR_NUMBER", json.loads(allowlist.group(1)))
726733
if title == "Substitute placeholders":
727734
self.assertIn("GH_AW_ENV_REVIEW_PR_NUMBER: process.env.GH_AW_ENV_REVIEW_PR_NUMBER",
728735
binding["with"]["script"])
729736
creator = step(document, "activation", "name", "Create prompt with built-in context")
730737
interpolator = step(document, "activation", "name", "Interpolate variables and render templates")
731-
self.assertIn("'interpolate_prompt.cjs'", interpolator["with"]["script"])
738+
self.assertRegex(interpolator["with"]["script"], r"require\([^)]*['/]interpolate_prompt\.cjs'\)")
732739
self.assertEqual(creator["env"]["GH_AW_PROMPT"], interpolator["env"]["GH_AW_PROMPT"])
733740

734741
def test_required_diff_failure_has_terminal_incomplete_prompt_delivery(self) -> None:

0 commit comments

Comments
 (0)