Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CI] [GHA] [AW] Migrate `bash` reusable jobs to Python (#36970)

Andrei Kashchikhin466c92fcd151
diff --git a/.github/aw/actions-lock.json b/.github/aw/actions-lock.json
index f825f778e64..483abd3db42 100644
--- a/.github/aw/actions-lock.json
+++ b/.github/aw/actions-lock.json
@@ -5,15 +5,15 @@
"version": "v9.0.0",
"sha": "3a2844b7e9c422d3c10d287c895573f7108da1b3"
},
- "github/gh-aw-actions/[email protected]": {
+ "github/gh-aw-actions/[email protected]": {
"repo": "github/gh-aw-actions/setup-cli",
- "version": "v0.82.14",
- "sha": "b6d1443e05b8716267fa19425b99aa4f12006b4a"
+ "version": "v0.83.4",
+ "sha": "e89c65e17eb281bbd5ff2ff9e9199a03e96654c7"
},
- "github/gh-aw-actions/[email protected]": {
+ "github/gh-aw-actions/[email protected]": {
"repo": "github/gh-aw-actions/setup",
- "version": "v0.82.14",
- "sha": "b6d1443e05b8716267fa19425b99aa4f12006b4a"
+ "version": "v0.83.4",
+ "sha": "e89c65e17eb281bbd5ff2ff9e9199a03e96654c7"
}
},
"containers": {
diff --git a/.github/scripts/agentic-workflows/__init__.py b/.github/scripts/agentic-workflows/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/.github/scripts/agentic-workflows/common.py b/.github/scripts/agentic-workflows/common.py
new file mode 100644
index 00000000000..94d3d107c8a
--- /dev/null
+++ b/.github/scripts/agentic-workflows/common.py
@@ -0,0 +1,107 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Shared helpers for the CI Doctor agentic-workflow scripts.
+
+Imported by the sibling scripts in this directory. They run as
+``python .github/scripts/agentic-workflows/<name>.py``, so this module's
+directory is on ``sys.path`` and a plain ``import common`` resolves here.
+
+Only the standard library is imported at module scope; PyGithub is imported
+lazily inside :func:`github_client` so scripts that do not need it (the Teams
+notifiers) can run without PyGithub installed.
+"""
+
+from __future__ import annotations
+
+import json
+import os
+import re
+import sys
+import urllib.error
+import urllib.request
+from typing import TYPE_CHECKING, Any
+
+if TYPE_CHECKING:
+ from github import Github
+
+_NUMERIC_RE = re.compile(r"[0-9]+")
+_REPOSITORY_RE = re.compile(r"[A-Za-z0-9._-]+/[A-Za-z0-9._-]+")
+
+
+def read_agent_item(item_type: str) -> dict[str, Any]:
+ """Return the last agent-output item of ``item_type`` (exits if absent).
+
+ The agent output path is taken from ``GH_AW_AGENT_OUTPUT``.
+ """
+ agent_output = os.environ.get("GH_AW_AGENT_OUTPUT", "")
+ if not agent_output or not os.path.isfile(agent_output):
+ sys.exit("No agent output found at GH_AW_AGENT_OUTPUT")
+
+ with open(agent_output, encoding="utf-8") as handle:
+ items = json.load(handle).get("items", [])
+
+ matching = [item for item in items if item.get("type") == item_type]
+ if not matching:
+ sys.exit(f"No {item_type} item present in agent output")
+ return matching[-1]
+
+
+def require_env(name: str, message: str | None = None) -> str:
+ """Return a non-empty environment variable ``name`` or exit with a message."""
+ value = os.environ.get(name, "")
+ if not value:
+ sys.exit(message or f"{name} is not configured")
+ return value
+
+
+def handle_numeric_id(value: str, label: str) -> str:
+ """Validate a purely numeric id (e.g. run_id / pr_number) to avoid injection."""
+ if not _NUMERIC_RE.fullmatch(value):
+ sys.exit(f"{label} must be a numeric string, got: '{value}'")
+ return value
+
+
+def resolve_repository(repository: str) -> str:
+ """Fall back to ``$GITHUB_REPOSITORY`` and validate the ``owner/repo`` form."""
+ if not repository or repository == "not_found":
+ repository = os.environ.get("GITHUB_REPOSITORY", "")
+ if not _REPOSITORY_RE.fullmatch(repository):
+ sys.exit(f"repository must be in owner/repo format, got: '{repository}'")
+ return repository
+
+
+def github_client(token: str) -> "Github":
+ """Build an authenticated PyGithub client (PyGithub imported lazily)."""
+ from github import Auth, Github
+
+ return Github(auth=Auth.Token(token))
+
+
+def post_adaptive_card(webhook_url: str, body: list[dict[str, Any]]) -> None:
+ """POST an Adaptive Card ``body`` to a Microsoft Teams incoming webhook."""
+ payload = {
+ "type": "message",
+ "attachments": [
+ {
+ "contentType": "application/vnd.microsoft.card.adaptive",
+ "content": {
+ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
+ "type": "AdaptiveCard",
+ "version": "1.4",
+ "body": body,
+ },
+ }
+ ],
+ }
+ request = urllib.request.Request(
+ webhook_url,
+ data=json.dumps(payload).encode("utf-8"),
+ headers={"Content-Type": "application/json"},
+ method="POST",
+ )
+ try:
+ with urllib.request.urlopen(request) as response:
+ print(f"Teams webhook responded with HTTP {response.status}: {response.read().decode('utf-8', 'replace')}")
+ except urllib.error.HTTPError as error:
+ sys.exit(f"Teams webhook failed with HTTP {error.code}: {error.read().decode('utf-8', 'replace')}")
diff --git a/.github/scripts/agentic-workflows/download_failure_logs.py b/.github/scripts/agentic-workflows/download_failure_logs.py
new file mode 100644
index 00000000000..10d04a77b9c
--- /dev/null
+++ b/.github/scripts/agentic-workflows/download_failure_logs.py
@@ -0,0 +1,226 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Pre-download failed CI logs and pre-locate error hints for the CI Doctor.
+
+Used by the shared pre-agent step of the CI Doctor workflows
+(.github/workflows/shared/agentic-workflows/download-failure-logs.md). Auto-
+detects its mode from the environment:
+ - run mode (RUN_ID set): analyse a single workflow run.
+ - pr mode (PR_NUMBER set): analyse every failed run on a PR head commit.
+Outputs go under /tmp/gh-aw/agent/ci-doctor/ (logs, hint files, summary).
+"""
+
+from __future__ import annotations
+
+import glob
+import json
+import os
+import re
+import sys
+import urllib.request
+from typing import TYPE_CHECKING, Any, TextIO
+
+from common import github_client
+
+if TYPE_CHECKING:
+ from github.Repository import Repository
+ from github.WorkflowJob import WorkflowJob
+ from github.WorkflowRun import WorkflowRun
+
+LOG_DIR = "/tmp/gh-aw/agent/ci-doctor/logs"
+FILTERED_DIR = "/tmp/gh-aw/agent/ci-doctor/filtered"
+SUMMARY_FILE = "/tmp/gh-aw/agent/ci-doctor/summary.txt"
+
+HINT_RE = re.compile(
+ r"(error[: ]|ERROR|FAIL|panic:|fatal[: ]|undefined[: ]|exception|exit status [^0])"
+)
+
+
+def line_count(text: str) -> int:
+ return text.count("\n")
+
+
+def download_job_log(job: "WorkflowJob") -> None:
+ """Download the log for a single failed job and pre-locate error hints."""
+ log_file = os.path.join(LOG_DIR, f"job-{job.id}.log")
+ print(f"Downloading log for job {job.id}...")
+ try:
+ with urllib.request.urlopen(job.logs_url()) as response:
+ content = response.read().decode("utf-8", "replace")
+ except Exception:
+ content = "(log download failed)\n"
+ with open(log_file, "w", encoding="utf-8") as handle:
+ handle.write(content)
+ print(f" -> Saved {line_count(content)} lines to {log_file}")
+
+ hints_file = os.path.join(FILTERED_DIR, f"job-{job.id}-hints.txt")
+ matches = []
+ for number, line in enumerate(content.splitlines(), start=1):
+ if HINT_RE.search(line):
+ matches.append(f"{number}:{line}")
+ if len(matches) >= 30:
+ break
+ if matches:
+ with open(hints_file, "w", encoding="utf-8") as handle:
+ handle.write("\n".join(matches) + "\n")
+ print(f" -> Pre-located {len(matches)} hint line(s) in {hints_file}")
+
+
+def failed_jobs_for_run(workflow_run: "WorkflowRun") -> list[dict[str, Any]]:
+ """Return the failed/cancelled jobs of a run as serialisable dicts."""
+ result: list[dict[str, Any]] = []
+ for job in workflow_run.jobs():
+ if job.conclusion in ("failure", "cancelled"):
+ failed_steps = [step.name for step in (job.steps or []) if step.conclusion == "failure"]
+ result.append({"id": job.id, "name": job.name, "failed_steps": failed_steps})
+ return result
+
+
+def write_summary_footer(handle: TextIO) -> None:
+ """Append the shared 'downloaded files' + 'hint files' footer to the summary."""
+ handle.write("\n")
+ handle.write(f"Downloaded job log files ({LOG_DIR}):\n")
+ for log_file in sorted(glob.glob(os.path.join(LOG_DIR, "job-*.log"))):
+ with open(log_file, encoding="utf-8") as fh:
+ count = line_count(fh.read())
+ handle.write(f" {log_file} ({count} lines)\n")
+ handle.write("\n")
+ handle.write(f"Filtered hint files ({FILTERED_DIR}):\n")
+ for hints_file in sorted(glob.glob(os.path.join(FILTERED_DIR, "*-hints.txt"))):
+ with open(hints_file, encoding="utf-8") as fh:
+ lines = fh.read().splitlines()
+ if not lines:
+ continue
+ handle.write(f" {hints_file} ({len(lines)} matches)\n")
+ for line in lines[:3]:
+ handle.write(f" {line}\n")
+
+
+def run_mode(repo: "Repository", run_id: str) -> None:
+ """Pre-download logs for a single workflow run (CI Doctor — Merge Queue)."""
+ print(f"=== CI Doctor: Pre-downloading logs for run {run_id} ===")
+
+ workflow_run = repo.get_workflow_run(int(run_id))
+ failed_jobs = failed_jobs_for_run(workflow_run)
+ with open(os.path.join(LOG_DIR, "failed-jobs.json"), "w", encoding="utf-8") as handle:
+ json.dump(failed_jobs, handle, indent=2)
+
+ failed_count = len(failed_jobs)
+ print(f"Found {failed_count} failed job(s)")
+
+ with open(SUMMARY_FILE, "w", encoding="utf-8") as handle:
+ handle.write("=== CI Doctor Pre-Analysis ===\n")
+ handle.write(f"Run ID: {run_id}\n")
+ handle.write("\n")
+ handle.write(f"Failed jobs (details in {LOG_DIR}/failed-jobs.json):\n")
+ for job in failed_jobs:
+ handle.write(f" Job {job['id']}: {job['name']}\n")
+ handle.write(f" Failed steps: {', '.join(job['failed_steps'])}\n")
+
+ if failed_count == 0:
+ print("No failed jobs found, skipping log download")
+ else:
+ print(json.dumps(failed_jobs, indent=2))
+ for job in workflow_run.jobs():
+ if job.conclusion in ("failure", "cancelled"):
+ download_job_log(job)
+
+ with open(SUMMARY_FILE, "a", encoding="utf-8") as handle:
+ write_summary_footer(handle)
+
+
+def pr_mode(repo: "Repository", pr_number: str) -> None:
+ """Pre-download logs for every failed run on a pull request head commit."""
+ print(f"=== CI Doctor: Pre-downloading logs for PR #{pr_number} ===")
+
+ try:
+ head_sha = repo.get_pull(int(pr_number)).head.sha
+ except Exception:
+ head_sha = ""
+ if not head_sha:
+ print("Could not resolve a pull request head SHA (is this a PR comment?), skipping log download")
+ with open(SUMMARY_FILE, "w", encoding="utf-8") as handle:
+ handle.write("No pull request context available.\n")
+ sys.exit(0)
+ print(f"PR head SHA: {head_sha}")
+
+ # Find all workflow runs for the PR head SHA that failed or were cancelled.
+ failed_runs: list[dict[str, Any]] = []
+ try:
+ for workflow_run in repo.get_workflow_runs(head_sha=head_sha):
+ if workflow_run.conclusion in ("failure", "cancelled"):
+ failed_runs.append({
+ "id": workflow_run.id,
+ "name": workflow_run.name,
+ "url": workflow_run.html_url,
+ "conclusion": workflow_run.conclusion,
+ })
+ except Exception:
+ failed_runs = []
+
+ # De-duplicate by workflow name, keeping the most recent (highest id) run per workflow.
+ latest_by_name: dict[str, dict[str, Any]] = {}
+ for entry in failed_runs:
+ current = latest_by_name.get(entry["name"])
+ if current is None or entry["id"] > current["id"]:
+ latest_by_name[entry["name"]] = entry
+ failed_runs = list(latest_by_name.values())
+
+ with open(os.path.join(LOG_DIR, "failed-runs.json"), "w", encoding="utf-8") as handle:
+ json.dump(failed_runs, handle, indent=2)
+
+ failed_count = len(failed_runs)
+ print(f"Found {failed_count} failed pipeline(s) on PR #{pr_number}")
+
+ with open(SUMMARY_FILE, "w", encoding="utf-8") as handle:
+ handle.write(f"=== CI Doctor Pre-Analysis (PR #{pr_number}, head {head_sha}) ===\n")
+ handle.write("\n")
+ handle.write(f"Failed pipelines (details in {LOG_DIR}/failed-runs.json):\n")
+ for entry in failed_runs:
+ handle.write(f" Run {entry['id']}: {entry['name']} [{entry['conclusion']}] {entry['url']}\n")
+
+ if failed_count == 0:
+ print("No failed pipelines found, skipping log download")
+ else:
+ print(json.dumps(failed_runs, indent=2))
+ for entry in failed_runs:
+ workflow_run = repo.get_workflow_run(int(entry["id"]))
+ run_failed_jobs = failed_jobs_for_run(workflow_run)
+ run_jobs_path = os.path.join(LOG_DIR, f"run-{entry['id']}-failed-jobs.json")
+ with open(run_jobs_path, "w", encoding="utf-8") as handle:
+ json.dump(run_failed_jobs, handle, indent=2)
+ for job in workflow_run.jobs():
+ if job.conclusion in ("failure", "cancelled"):
+ download_job_log(job)
+
+ with open(SUMMARY_FILE, "a", encoding="utf-8") as handle:
+ write_summary_footer(handle)
+
+
+def main() -> None:
+ os.makedirs(LOG_DIR, exist_ok=True)
+ os.makedirs(FILTERED_DIR, exist_ok=True)
+
+ repo_name = os.environ.get("REPO", "")
+ run_id = (os.environ.get("RUN_ID") or "").strip()
+ pr_number = (os.environ.get("PR_NUMBER") or "").strip()
+ token = os.environ.get("GH_TOKEN", "")
+
+ repo = github_client(token).get_repo(repo_name)
+
+ if run_id:
+ run_mode(repo, run_id)
+ elif pr_number:
+ pr_mode(repo, pr_number)
+ else:
+ print("Neither RUN_ID nor PR_NUMBER is set; nothing to pre-download.")
+ with open(SUMMARY_FILE, "w", encoding="utf-8") as handle:
+ handle.write("No CI Doctor context (no RUN_ID or PR_NUMBER).\n")
+
+ print("")
+ print(f"Pre-analysis complete. Agent should start with {SUMMARY_FILE}")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/scripts/agentic-workflows/notify_teams.py b/.github/scripts/agentic-workflows/notify_teams.py
new file mode 100644
index 00000000000..5825f7a6376
--- /dev/null
+++ b/.github/scripts/agentic-workflows/notify_teams.py
@@ -0,0 +1,114 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Send a CI failure investigation summary to Microsoft Teams.
+
+Used by the `notify-teams` custom safe-output job of the CI Doctor MQ workflow
+(.github/workflows/shared/agentic-workflows/notify-teams.md). Reads the agent
+output referenced by GH_AW_AGENT_OUTPUT, persists the statistics database as a
+workflow artifact, and posts an Adaptive Card to TEAMS_WEBHOOK_URL.
+"""
+
+from __future__ import annotations
+
+import json
+import os
+import sys
+from typing import Any
+
+from common import post_adaptive_card, read_agent_item, require_env
+
+
+def persist_statistics(item: dict[str, Any]) -> str:
+ """Persist the statistics database as workflow-artifact files; return its dir."""
+ stats_dir = os.path.join(os.environ.get("RUNNER_TEMP", "/tmp"), "ci-doctor-mq-stats")
+ os.makedirs(stats_dir, exist_ok=True)
+
+ statistics_json = item.get("statistics_json") or ""
+ if statistics_json:
+ stats_json_path = os.path.join(stats_dir, "ci-doctor-mq-statistics.json")
+ try:
+ # Validate and pretty-print; fall back to raw on parse error.
+ parsed = json.loads(statistics_json)
+ with open(stats_json_path, "w", encoding="utf-8") as handle:
+ json.dump(parsed, handle, indent=2)
+ print(f"Wrote validated statistics JSON ({os.path.getsize(stats_json_path)} bytes)")
+ except json.JSONDecodeError:
+ print("Warning: statistics_json failed JSON parse; storing raw payload", file=sys.stderr)
+ with open(stats_json_path, "w", encoding="utf-8") as handle:
+ handle.write(statistics_json)
+
+ statistics = item.get("statistics") or ""
+ if statistics:
+ with open(os.path.join(stats_dir, "ci-doctor-mq-statistics.md"), "w", encoding="utf-8") as handle:
+ handle.write(statistics + "\n")
+ return stats_dir
+
+
+def record_step_output(name: str, value: str) -> None:
+ """Append ``name=value`` to the GitHub Actions step output file, when set."""
+ github_output = os.environ.get("GITHUB_OUTPUT")
+ if github_output:
+ with open(github_output, "a", encoding="utf-8") as handle:
+ handle.write(f"{name}={value}\n")
+
+
+def build_facts(item: dict[str, Any]) -> list[dict[str, str]]:
+ """Build the Adaptive Card FactSet, including only populated fields."""
+ facts: list[dict[str, str]] = []
+ failed_workflow = item.get("failed_workflow") or ""
+ pipeline_url = item.get("pipeline_url") or ""
+ pr_number = item.get("pr_number") or ""
+ pr_url = item.get("pr_url") or ""
+ author = item.get("author") or ""
+ occurrences = item.get("occurrence_count") or ""
+ db_entries = item.get("db_entries") or ""
+
+ if failed_workflow:
+ facts.append({"title": "Workflow", "value": failed_workflow})
+ if pipeline_url:
+ facts.append({"title": "Pipeline", "value": f"[Open run]({pipeline_url})"})
+ if pr_number:
+ pr_value = f"[#{pr_number}]({pr_url})" if pr_url else f"#{pr_number}"
+ facts.append({"title": "PR", "value": pr_value})
+ if author:
+ facts.append({"title": "Author", "value": f"@{author}"})
+ if occurrences:
+ facts.append({"title": "Occurrences", "value": f"{occurrences}\u00d7"})
+ if db_entries:
+ facts.append({"title": "DB entries", "value": db_entries})
+ return facts
+
+
+def build_body(item: dict[str, Any], facts: list[dict[str, str]]) -> list[dict[str, Any]]:
+ """Build the Adaptive Card body blocks for the investigation notification."""
+ title = item.get("title") or ""
+ description = item.get("description") or ""
+ statistics = item.get("statistics") or ""
+
+ body: list[dict[str, Any]] = [
+ {"type": "TextBlock", "text": f"\U0001f534 [MQ] {title}", "weight": "Bolder", "size": "Medium", "color": "Attention", "wrap": True},
+ {"type": "FactSet", "facts": facts},
+ {"type": "TextBlock", "text": description, "wrap": True, "spacing": "Medium"},
+ ]
+ if statistics:
+ body.append({"type": "TextBlock", "text": "Pattern Database Statistics", "weight": "Bolder", "size": "Medium", "spacing": "Large", "separator": True})
+ body.append({"type": "TextBlock", "text": statistics, "wrap": True, "spacing": "Small"})
+ return body
+
+
+def main() -> None:
+ webhook_url = require_env("TEAMS_WEBHOOK_URL", "TEAMS_WEBHOOK_URL secret is not configured")
+ item = read_agent_item("notify_teams")
+
+ # Persist the full statistics database as a workflow artifact for offline review.
+ stats_dir = persist_statistics(item)
+ record_step_output("stats_dir", stats_dir)
+
+ facts = build_facts(item)
+ body = build_body(item, facts)
+ post_adaptive_card(webhook_url, body)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/scripts/agentic-workflows/notify_teams_recurring.py b/.github/scripts/agentic-workflows/notify_teams_recurring.py
new file mode 100644
index 00000000000..31fee1b318a
--- /dev/null
+++ b/.github/scripts/agentic-workflows/notify_teams_recurring.py
@@ -0,0 +1,55 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Send a recurring merge-queue failure escalation alert to Microsoft Teams.
+
+Used by the `notify-teams-recurring` custom safe-output job of the CI Doctor MQ
+workflow (.github/workflows/shared/agentic-workflows/notify-teams-recurring.md).
+Reads the agent output referenced by GH_AW_AGENT_OUTPUT and posts an Adaptive
+Card to TEAMS_WEBHOOK_URL.
+"""
+
+from __future__ import annotations
+
+from typing import Any
+
+from common import post_adaptive_card, read_agent_item, require_env
+
+
+def build_facts(item: dict[str, Any]) -> list[dict[str, str]]:
+ """Build the fixed three-fact FactSet for the recurring-failure card."""
+ failed_workflow = item.get("failed_workflow") or ""
+ pipeline_url = item.get("pipeline_url") or ""
+ recent_count = item.get("recent_count") or ""
+ return [
+ {"title": "Workflow", "value": failed_workflow},
+ {"title": "Pipeline", "value": f"[Latest run]({pipeline_url})"},
+ {"title": "Hits (last 12 hrs)", "value": f"{recent_count} occurrences"},
+ ]
+
+
+def build_body(item: dict[str, Any]) -> list[dict[str, Any]]:
+ """Build the Adaptive Card body blocks for the recurring-failure alert."""
+ title = item.get("title") or ""
+ description = item.get("description") or ""
+ affected_prs = item.get("affected_prs") or ""
+ recent_runs = item.get("recent_run_urls") or ""
+ return [
+ {"type": "TextBlock", "text": f"\U0001f501 [MQ] Recurring Failure: {title}", "weight": "Bolder", "size": "Medium", "color": "Warning", "wrap": True},
+ {"type": "FactSet", "facts": build_facts(item)},
+ {"type": "TextBlock", "text": description, "wrap": True, "spacing": "Medium"},
+ {"type": "TextBlock", "text": "### Affected PRs", "weight": "Bolder", "spacing": "Large", "separator": True},
+ {"type": "TextBlock", "text": affected_prs, "wrap": True, "spacing": "Small"},
+ {"type": "TextBlock", "text": "### Recent Failure Runs", "weight": "Bolder", "spacing": "Large", "separator": True},
+ {"type": "TextBlock", "text": recent_runs, "wrap": True, "spacing": "Small"},
+ ]
+
+
+def main() -> None:
+ webhook_url = require_env("TEAMS_WEBHOOK_URL", "TEAMS_WEBHOOK_URL secret is not configured")
+ item = read_agent_item("notify_teams_recurring")
+ post_adaptive_card(webhook_url, build_body(item))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/scripts/agentic-workflows/readd_to_merge_queue.py b/.github/scripts/agentic-workflows/readd_to_merge_queue.py
new file mode 100644
index 00000000000..61da47e0794
--- /dev/null
+++ b/.github/scripts/agentic-workflows/readd_to_merge_queue.py
@@ -0,0 +1,95 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Re-add a pull request dropped from the merge queue back into the queue.
+
+Used by the `readd-to-merge-queue` custom safe-output job of the CI Doctor MQ
+workflow (.github/workflows/shared/agentic-workflows/readd-to-merge-queue.md).
+Reads the agent output referenced by GH_AW_AGENT_OUTPUT, and re-adds the PR via
+`gh pr merge` (which enqueues on a merge-queue branch). It is idempotent: it
+skips merged/closed/draft PRs and PRs already carrying a re-add marker comment.
+"""
+
+from __future__ import annotations
+
+import subprocess
+from typing import TYPE_CHECKING
+
+from common import github_client, handle_numeric_id, read_agent_item, require_env, resolve_repository
+
+if TYPE_CHECKING:
+ from github.PullRequest import PullRequest
+
+MARKER = "<!-- ci-doctor-mq-readd -->"
+
+
+def already_readded(pull: "PullRequest") -> bool:
+ """Return True if a previous CI Doctor re-add marker comment is present."""
+ return any(MARKER in (comment.body or "") for comment in pull.get_issue_comments())
+
+
+def skip_reason(pull: "PullRequest", pr_number: str) -> str | None:
+ """Return a human-readable reason to skip re-adding, or None to proceed."""
+ if pull.merged:
+ return f"PR #{pr_number} is already merged; nothing to re-add."
+ if pull.state != "open":
+ return f"PR #{pr_number} is not open (state={pull.state}); not re-adding."
+ if pull.draft:
+ return f"PR #{pr_number} is a draft; not re-adding."
+ return None
+
+
+def enqueue(pull: "PullRequest", pr_number: str, repository: str) -> None:
+ """Re-add the PR to the merge queue via ``gh pr merge``.
+
+ On a branch that requires a merge queue, ``gh pr merge`` adds the PR to the
+ queue (using the queue's own configured merge method) instead of merging
+ directly. ``--squash`` keeps the CLI non-interactive; ``--match-head-commit``
+ guards against the head moving under us.
+ """
+ merge_command = ["gh", "pr", "merge", pr_number, "--repo", repository, "--squash"]
+ if pull.head.sha:
+ merge_command += ["--match-head-commit", pull.head.sha]
+ result = subprocess.run(merge_command, capture_output=True, text=True)
+ if result.returncode != 0:
+ raise SystemExit(f"Merge-queue enqueue failed: {result.stderr.strip()}")
+
+
+def record_marker(pull: "PullRequest", reason: str) -> None:
+ """Comment a marker so subsequent CI Doctor runs do not re-add again."""
+ comment_body = (
+ f"{MARKER}\n\n_CI Doctor re-added this pull request to the merge queue "
+ f"after a transient failure (reason: {reason})._"
+ )
+ pull.create_issue_comment(comment_body)
+
+
+def main() -> None:
+ token = require_env("GH_TOKEN", "MERGE_QUEUE_TOKEN secret is not configured; cannot re-add to merge queue.")
+ item = read_agent_item("readd_to_merge_queue")
+ pr_number = handle_numeric_id(item.get("pr_number") or "", "pr_number")
+ repository = resolve_repository(item.get("repository") or "")
+ reason = item.get("reason") or ""
+
+ print(f"Requested re-add of PR #{pr_number} in {repository} to merge queue (reason: {reason})")
+
+ pull = github_client(token).get_repo(repository).get_pull(int(pr_number))
+
+ if already_readded(pull):
+ print(f"PR #{pr_number} already re-added by CI Doctor (marker comment found); skipping.")
+ return
+
+ reason_to_skip = skip_reason(pull, pr_number)
+ if reason_to_skip:
+ print(reason_to_skip)
+ return
+
+ enqueue(pull, pr_number, repository)
+ print(f"Successfully requested re-add of PR #{pr_number} to the merge queue.")
+
+ record_marker(pull, reason)
+ print(f"Recorded re-add marker comment on PR #{pr_number}.")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/scripts/agentic-workflows/rerun_failed_jobs.py b/.github/scripts/agentic-workflows/rerun_failed_jobs.py
new file mode 100644
index 00000000000..c53033eefb0
--- /dev/null
+++ b/.github/scripts/agentic-workflows/rerun_failed_jobs.py
@@ -0,0 +1,51 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Re-run ONLY the failed jobs of an analysed GitHub Actions workflow run.
+
+Used by the `rerun-failed-jobs` custom safe-output job of the CI Doctor MQ
+workflow (.github/workflows/shared/agentic-workflows/rerun-failed-jobs.md).
+Reads the agent output referenced by GH_AW_AGENT_OUTPUT and calls the GitHub
+Actions rerun-failed-jobs endpoint via PyGithub.
+"""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
+from common import github_client, handle_numeric_id, read_agent_item, require_env, resolve_repository
+
+if TYPE_CHECKING:
+ from github.WorkflowRun import WorkflowRun
+
+
+def trigger_rerun(run: "WorkflowRun", run_id: str, repository: str) -> None:
+ """Re-run only the failed jobs of ``run``, guarding against restart loops."""
+ # If the run has already been attempted more than once, do not re-run it
+ # again (mirrors rerunner.py).
+ attempt = run.run_attempt or 1
+ if attempt > 1:
+ print(f"Run {run_id} already has {attempt} attempts; not re-running to avoid loops.")
+ return
+
+ if not run.rerun_failed_jobs():
+ raise SystemExit(f"GitHub API rejected the re-run request for {repository} run {run_id}.")
+
+ print(f"Successfully requested re-run of failed jobs for {repository} run {run_id}.")
+
+
+def main() -> None:
+ item = read_agent_item("rerun_failed_jobs")
+ run_id = handle_numeric_id(item.get("run_id") or "", "run_id")
+ repository = resolve_repository(item.get("repository") or "")
+ reason = item.get("reason") or ""
+
+ print(f"Requested re-run of failed jobs for {repository} run {run_id} (reason: {reason})")
+
+ token = require_env("GH_TOKEN", "GITHUB_TOKEN is not configured; cannot re-run failed jobs.")
+ run = github_client(token).get_repo(repository).get_workflow_run(int(run_id))
+ trigger_rerun(run, run_id, repository)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/workflows/ci-doctor-mq.lock.yml b/.github/workflows/ci-doctor-mq.lock.yml
index 679fe033f49..1f9ad93788d 100644
--- a/.github/workflows/ci-doctor-mq.lock.yml
+++ b/.github/workflows/ci-doctor-mq.lock.yml
@@ -1,6 +1,6 @@
-# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"b9d2d3ec536c0c28b3f6c7b61d0c34cc24bfaf587148b93c2529182eb7f8c8ae","body_hash":"5453aae8ea48a65fa83acd89b195dc9b2a39c963a88c3fd299c096fe39116194","compiler_version":"v0.82.14","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6","engine_versions":{"copilot":"1.0.71"}}
-# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","MERGE_QUEUE_TOKEN","TEAMS_WEBHOOK_URL"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"b6d1443e05b8716267fa19425b99aa4f12006b4a","version":"v0.82.14"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.37","digest":"sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.37@sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37","digest":"sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37@sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.37","digest":"sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.37@sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.1","digest":"sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.1@sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.6.0","digest":"sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3","pinned_image":"ghcr.io/github/github-mcp-server:v1.6.0@sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3"}]}
-# This file was automatically generated by gh-aw (v0.82.14). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md
+# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"91233e936b75a0c51f19fe12afec70e1e7fd16b1eece9c4d72710ea1322da038","body_hash":"5453aae8ea48a65fa83acd89b195dc9b2a39c963a88c3fd299c096fe39116194","compiler_version":"v0.83.4","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6","engine_versions":{"copilot":"1.0.75"}}
+# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN","MERGE_QUEUE_TOKEN","TEAMS_WEBHOOK_URL"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/setup-python","sha":"a309ff8b426b58ec0e2a45f0f869d46889d02405","version":"a309ff8b426b58ec0e2a45f0f869d46889d02405"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"e89c65e17eb281bbd5ff2ff9e9199a03e96654c7","version":"v0.83.4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42","digest":"sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42","digest":"sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42","digest":"sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.6","digest":"sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748","pinned_image":"ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748"},{"image":"ghcr.io/github/github-mcp-server:v1.7.0","digest":"sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308","pinned_image":"ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308"}]}
+# This file was automatically generated by gh-aw (v0.83.4). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md
#
# ___ _ _
# / _ \ | | (_)
@@ -47,21 +47,23 @@
# Custom actions used:
# - actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
# - actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
-# - actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+# - actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+# - actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
# - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 (source v9)
# - actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
+# - actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # a309ff8b426b58ec0e2a45f0f869d46889d02405
# - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
-# - github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+# - github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
#
# Container images used:
-# - ghcr.io/github/gh-aw-firewall/agent:0.27.37@sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67
-# - ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37@sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317
-# - ghcr.io/github/gh-aw-firewall/squid:0.27.37@sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b
-# - ghcr.io/github/gh-aw-mcpg:v0.4.1@sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32
-# - ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b
-# - ghcr.io/github/github-mcp-server:v1.6.0@sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3
+# - ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b
+# - ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607
+# - ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0
+# - ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c
+# - ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748
+# - ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308
name: "CI Failure Doctor — Merge Queue"
on:
@@ -137,7 +139,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -147,8 +149,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor — Merge Queue"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor-mq.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Generate agentic run info
id: generate_aw_info
@@ -156,16 +158,16 @@ jobs:
GH_AW_INFO_ENGINE_ID: "copilot"
GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI"
GH_AW_INFO_MODEL: "claude-sonnet-4.6"
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AGENT_VERSION: "1.0.71"
- GH_AW_INFO_CLI_VERSION: "v0.82.14"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AGENT_VERSION: "1.0.75"
+ GH_AW_INFO_CLI_VERSION: "v0.83.4"
GH_AW_INFO_WORKFLOW_NAME: "CI Failure Doctor — Merge Queue"
GH_AW_INFO_EXPERIMENTAL: "false"
GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true"
GH_AW_INFO_STAGED: "false"
GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]'
GH_AW_INFO_FIREWALL_ENABLED: "true"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_AWMG_VERSION: ""
GH_AW_INFO_FIREWALL_TYPE: "squid"
GH_AW_COMPILED_STRICT: "true"
@@ -233,7 +235,7 @@ jobs:
GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
- name: Checkout .github and .agents folders
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: |
@@ -268,7 +270,7 @@ jobs:
- name: Check compile-agentic version
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
- GH_AW_COMPILED_VERSION: "v0.82.14"
+ GH_AW_COMPILED_VERSION: "v0.83.4"
with:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
@@ -507,7 +509,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -516,8 +518,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor — Merge Queue"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor-mq.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Set runtime paths
id: set-runtime-paths
@@ -528,7 +530,7 @@ jobs:
echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json"
} >> "$GITHUB_OUTPUT"
- name: Checkout repository
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Create gh-aw temp directory
@@ -552,13 +554,21 @@ jobs:
MEMORY_DIR: /tmp/gh-aw/repo-memory/default
CREATE_ORPHAN: true
run: bash "${RUNNER_TEMP}/gh-aw/actions/clone_repo_memory_branch.sh"
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # a309ff8b426b58ec0e2a45f0f869d46889d02405
+ with:
+ python-version: "3.13"
+ - name: Install PyGithub
+ run: python -m pip install --quiet PyGithub
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.event.workflow_run.id || github.event.inputs.run_id }}
name: Download CI failure logs
- run: "set -e\nLOG_DIR=\"/tmp/gh-aw/agent/ci-doctor/logs\"\nFILTERED_DIR=\"/tmp/gh-aw/agent/ci-doctor/filtered\"\nSUMMARY_FILE=\"/tmp/gh-aw/agent/ci-doctor/summary.txt\"\nmkdir -p \"$LOG_DIR\" \"$FILTERED_DIR\"\n\n# Download the log for a single failed job and pre-locate error hints.\ndownload_job_log() {\n JOB_ID=\"$1\"\n LOG_FILE=\"$LOG_DIR/job-${JOB_ID}.log\"\n echo \"Downloading log for job $JOB_ID...\"\n gh api \"repos/$REPO/actions/jobs/$JOB_ID/logs\" > \"$LOG_FILE\" 2>/dev/null \\\n || echo \"(log download failed)\" > \"$LOG_FILE\"\n echo \" -> Saved $(wc -l < \"$LOG_FILE\") lines to $LOG_FILE\"\n\n HINTS_FILE=\"$FILTERED_DIR/job-${JOB_ID}-hints.txt\"\n grep -n -m 30 -iE \"(error[: ]|ERROR|FAIL|panic:|fatal[: ]|undefined[: ]|exception|exit status [^0])\" \\\n \"$LOG_FILE\" > \"$HINTS_FILE\" 2>/dev/null || true\n if [ -s \"$HINTS_FILE\" ]; then\n echo \" -> Pre-located $(wc -l < \"$HINTS_FILE\") hint line(s) in $HINTS_FILE\"\n fi\n}\n\n# Append the shared \"downloaded files\" + \"hint files\" footer to the summary.\nwrite_summary_footer() {\n echo \"\"\n echo \"Downloaded job log files ($LOG_DIR):\"\n for LOG_FILE in \"$LOG_DIR\"/job-*.log; do\n [ -f \"$LOG_FILE\" ] || continue\n echo \" $LOG_FILE ($(wc -l < \"$LOG_FILE\") lines)\"\n done\n echo \"\"\n echo \"Filtered hint files ($FILTERED_DIR):\"\n for HINTS_FILE in \"$FILTERED_DIR\"/*-hints.txt; do\n [ -s \"$HINTS_FILE\" ] || continue\n echo \" $HINTS_FILE ($(wc -l < \"$HINTS_FILE\") matches)\"\n head -3 \"$HINTS_FILE\" | sed 's/^/ /'\n done\n}\n\nif [ -n \"$RUN_ID\" ]; then\n # ---- run mode: a single workflow run (CI Doctor — Merge Queue) ----\n echo \"=== CI Doctor: Pre-downloading logs for run $RUN_ID ===\"\n\n gh api \"repos/$REPO/actions/runs/$RUN_ID/jobs\" \\\n --jq '[.jobs[] | select(.conclusion == \"failure\" or .conclusion == \"cancelled\") | {id:.id, name:.name, failed_steps:[.steps[]? | select(.conclusion==\"failure\") | .name]}]' \\\n > \"$LOG_DIR/failed-jobs.json\"\n\n FAILED_COUNT=$(jq 'length' \"$LOG_DIR/failed-jobs.json\")\n echo \"Found $FAILED_COUNT failed job(s)\"\n\n {\n echo \"=== CI Doctor Pre-Analysis ===\"\n echo \"Run ID: $RUN_ID\"\n echo \"\"\n echo \"Failed jobs (details in $LOG_DIR/failed-jobs.json):\"\n jq -r '.[] | \" Job \\(.id): \\(.name)\\n Failed steps: \\(.failed_steps | join(\", \"))\"' \\\n \"$LOG_DIR/failed-jobs.json\"\n } > \"$SUMMARY_FILE\"\n\n if [ \"$FAILED_COUNT\" -eq 0 ]; then\n echo \"No failed jobs found, skipping log download\"\n else\n cat \"$LOG_DIR/failed-jobs.json\"\n jq -r '.[].id' \"$LOG_DIR/failed-jobs.json\" | while read -r JOB_ID; do\n download_job_log \"$JOB_ID\"\n done\n fi\n\n write_summary_footer >> \"$SUMMARY_FILE\"\n\nelif [ -n \"$PR_NUMBER\" ]; then\n # ---- pr mode: every failed run on a pull request head commit ----\n echo \"=== CI Doctor: Pre-downloading logs for PR #$PR_NUMBER ===\"\n\n HEAD_SHA=$(gh api \"repos/$REPO/pulls/$PR_NUMBER\" --jq '.head.sha' 2>/dev/null || echo \"\")\n if [ -z \"$HEAD_SHA\" ]; then\n echo \"Could not resolve a pull request head SHA (is this a PR comment?), skipping log download\"\n echo \"No pull request context available.\" > \"$SUMMARY_FILE\"\n exit 0\n fi\n echo \"PR head SHA: $HEAD_SHA\"\n\n # Find all workflow runs for the PR head SHA that failed or were cancelled\n gh api --paginate \"repos/$REPO/actions/runs?head_sha=$HEAD_SHA\" \\\n --jq '[.workflow_runs[] | select(.conclusion == \"failure\" or .conclusion == \"cancelled\") | {id:.id, name:.name, url:.html_url, conclusion:.conclusion}]' \\\n > \"$LOG_DIR/failed-runs.json\" 2>/dev/null || echo '[]' > \"$LOG_DIR/failed-runs.json\"\n\n # De-duplicate by workflow name, keeping the most recent (highest id) run per workflow\n jq 'group_by(.name) | map(max_by(.id))' \"$LOG_DIR/failed-runs.json\" > \"$LOG_DIR/failed-runs.dedup.json\"\n mv \"$LOG_DIR/failed-runs.dedup.json\" \"$LOG_DIR/failed-runs.json\"\n\n FAILED_COUNT=$(jq 'length' \"$LOG_DIR/failed-runs.json\")\n echo \"Found $FAILED_COUNT failed pipeline(s) on PR #$PR_NUMBER\"\n\n {\n echo \"=== CI Doctor Pre-Analysis (PR #$PR_NUMBER, head $HEAD_SHA) ===\"\n echo \"\"\n echo \"Failed pipelines (details in $LOG_DIR/failed-runs.json):\"\n jq -r '.[] | \" Run \\(.id): \\(.name) [\\(.conclusion)] \\(.url)\"' \"$LOG_DIR/failed-runs.json\"\n } > \"$SUMMARY_FILE\"\n\n if [ \"$FAILED_COUNT\" -eq 0 ]; then\n echo \"No failed pipelines found, skipping log download\"\n else\n cat \"$LOG_DIR/failed-runs.json\"\n jq -r '.[].id' \"$LOG_DIR/failed-runs.json\" | while read -r RUN_ID; do\n gh api \"repos/$REPO/actions/runs/$RUN_ID/jobs\" \\\n --jq '[.jobs[] | select(.conclusion == \"failure\" or .conclusion == \"cancelled\") | {id:.id, name:.name, failed_steps:[.steps[]? | select(.conclusion==\"failure\") | .name]}]' \\\n > \"$LOG_DIR/run-${RUN_ID}-failed-jobs.json\" 2>/dev/null || echo '[]' > \"$LOG_DIR/run-${RUN_ID}-failed-jobs.json\"\n\n jq -r '.[].id' \"$LOG_DIR/run-${RUN_ID}-failed-jobs.json\" | while read -r JOB_ID; do\n download_job_log \"$JOB_ID\"\n done\n done\n fi\n\n write_summary_footer >> \"$SUMMARY_FILE\"\n\nelse\n echo \"Neither RUN_ID nor PR_NUMBER is set; nothing to pre-download.\"\n echo \"No CI Doctor context (no RUN_ID or PR_NUMBER).\" > \"$SUMMARY_FILE\"\nfi\n\necho \"\"\necho \"✅ Pre-analysis complete. Agent should start with $SUMMARY_FILE\"\n"
+ run: |
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/download_failure_logs.py
- name: Configure Git credentials
env:
@@ -581,11 +591,11 @@ jobs:
const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs');
await main();
- name: Install GitHub Copilot CLI
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.71
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.75
env:
GH_HOST: github.com
- name: Install AWF binary
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.37 --rootless
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.42 --rootless
- name: Determine automatic lockdown mode for GitHub MCP Server
id: determine-automatic-lockdown
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 (source v9)
@@ -612,7 +622,7 @@ jobs:
GH_AW_SKILL_DIR: ".github/skills"
run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_inline_skills.sh"
- name: Download container images
- run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.37@sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67 ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37@sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317 ghcr.io/github/gh-aw-firewall/squid:0.27.37@sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b ghcr.io/github/gh-aw-mcpg:v0.4.1@sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32 ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b ghcr.io/github/github-mcp-server:v1.6.0@sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607 ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0 ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748 ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308
- name: Generate Safe Outputs Config
run: |
mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs"
@@ -936,16 +946,16 @@ jobs:
MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0')
MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0')
source "${RUNNER_TEMP}/gh-aw/actions/resolve_docker_socket_gid.sh"
- export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network bridge -p 127.0.0.1:'"${MCP_GATEWAY_PORT}"':'"${MCP_GATEWAY_PORT}"' --name awmg-mcpg --add-host host.docker.internal:host-gateway --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DOCKER_HOST=unix:///var/run/docker.sock -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_POLICY_ALLOW_CREATE_PULL_REQUEST -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e RUNNER_TEMP -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw -v '"${RUNNER_TEMP}"'/gh-aw/safeoutputs:'"${RUNNER_TEMP}"'/gh-aw/safeoutputs:rw ghcr.io/github/gh-aw-mcpg:v0.4.1'
+ export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network bridge -p 127.0.0.1:'"${MCP_GATEWAY_PORT}"':'"${MCP_GATEWAY_PORT}"' --name awmg-mcpg --add-host host.docker.internal:host-gateway --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DOCKER_HOST=unix:///var/run/docker.sock -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_POLICY_ALLOW_CREATE_PULL_REQUEST -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e RUNNER_TEMP -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw -v '"${RUNNER_TEMP}"'/gh-aw/safeoutputs:'"${RUNNER_TEMP}"'/gh-aw/safeoutputs:rw ghcr.io/github/gh-aw-mcpg:v0.4.6'
mkdir -p "$HOME/.copilot"
GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node)
- cat << GH_AW_MCP_CONFIG_aa7b5de0d299165b_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
+ cat << GH_AW_MCP_CONFIG_bcbb445f12830b86_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
{
"mcpServers": {
"github": {
"type": "stdio",
- "container": "ghcr.io/github/github-mcp-server:v1.6.0",
+ "container": "ghcr.io/github/github-mcp-server:v1.7.0",
"env": {
"GITHUB_FEATURES": "fields_param",
"GITHUB_HOST": "${GITHUB_SERVER_URL}",
@@ -1002,7 +1012,7 @@ jobs:
"startupTimeout": 120
}
}
- GH_AW_MCP_CONFIG_aa7b5de0d299165b_EOF
+ GH_AW_MCP_CONFIG_bcbb445f12830b86_EOF
- name: Mount MCP servers as CLIs
id: mount-mcp-clis
continue-on-error: true
@@ -1031,7 +1041,7 @@ jobs:
run: |
set -o pipefail
printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
- trap 'rm -f "$HOME/.copilot/settings.json"' EXIT
+ trap 'gh_aw_exit_code=$?; mkdir -p /tmp/gh-aw >/dev/null 2>&1 || true; printf "%s" "$gh_aw_exit_code" > /tmp/gh-aw/agent_execution_exit_code.txt || true; rm -f "$HOME/.copilot/settings.json"' EXIT
mkdir -p "$HOME/.copilot"
printf '%s' '{"builtInAgents":{"rubberDuck":false}}' > "$HOME/.copilot/settings.json"
export XDG_CONFIG_HOME="$HOME"
@@ -1042,7 +1052,7 @@ jobs:
export COPILOT_API_KEY="$COPILOT_DUMMY_BYOK"
(umask 177 && touch /tmp/gh-aw/agent-stdio.log)
GH_AW_MAX_AI_CREDITS="${GH_AW_MAX_AI_CREDITS:-1000}"
- printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.37/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"api.business.githubcopilot.com\",\"api.enterprise.githubcopilot.com\",\"api.github.com\",\"api.githubcopilot.com\",\"api.individual.githubcopilot.com\",\"api.snapcraft.io\",\"archive.ubuntu.com\",\"azure.archive.ubuntu.com\",\"crl.geotrust.com\",\"crl.globalsign.com\",\"crl.identrust.com\",\"crl.sectigo.com\",\"crl.thawte.com\",\"crl.usertrust.com\",\"crl.verisign.com\",\"crl3.digicert.com\",\"crl4.digicert.com\",\"crls.ssl.com\",\"github.com\",\"host.docker.internal\",\"json-schema.org\",\"json.schemastore.org\",\"keyserver.ubuntu.com\",\"ocsp.digicert.com\",\"ocsp.geotrust.com\",\"ocsp.globalsign.com\",\"ocsp.identrust.com\",\"ocsp.sectigo.com\",\"ocsp.ssl.com\",\"ocsp.thawte.com\",\"ocsp.usertrust.com\",\"ocsp.verisign.com\",\"packagecloud.io\",\"packages.cloud.google.com\",\"packages.microsoft.com\",\"ppa.launchpad.net\",\"raw.githubusercontent.com\",\"registry.npmjs.org\",\"s.symcb.com\",\"s.symcd.com\",\"security.ubuntu.com\",\"telemetry.enterprise.githubcopilot.com\",\"ts-crl.ws.symantec.com\",\"ts-ocsp.ws.symantec.com\",\"www.googleapis.com\"],\"isolation\":true,\"topologyAttach\":[\"awmg-mcpg\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-5.4\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"fable\",\"sonnet\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mai-code-1-flash-picker\":[\"copilot/MAI-Code-1-Flash-picker*\",\"copilot/mai-code-1-flash-picker*\",\"openai/MAI-Code-1-Flash-picker*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.27.37,squid=sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b,agent=sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67,api-proxy=sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317,cli-proxy=sha256:1d5300d9b08e1c4f2ad1830860656a0656383a83280058f17e805a7c3ecda203\"},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
+ printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.42/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"api.business.githubcopilot.com\",\"api.enterprise.githubcopilot.com\",\"api.github.com\",\"api.githubcopilot.com\",\"api.individual.githubcopilot.com\",\"api.snapcraft.io\",\"archive.ubuntu.com\",\"azure.archive.ubuntu.com\",\"crl.geotrust.com\",\"crl.globalsign.com\",\"crl.identrust.com\",\"crl.sectigo.com\",\"crl.thawte.com\",\"crl.usertrust.com\",\"crl.verisign.com\",\"crl3.digicert.com\",\"crl4.digicert.com\",\"crls.ssl.com\",\"github.com\",\"host.docker.internal\",\"json-schema.org\",\"json.schemastore.org\",\"keyserver.ubuntu.com\",\"ocsp.digicert.com\",\"ocsp.geotrust.com\",\"ocsp.globalsign.com\",\"ocsp.identrust.com\",\"ocsp.sectigo.com\",\"ocsp.ssl.com\",\"ocsp.thawte.com\",\"ocsp.usertrust.com\",\"ocsp.verisign.com\",\"packagecloud.io\",\"packages.cloud.google.com\",\"packages.microsoft.com\",\"ppa.launchpad.net\",\"raw.githubusercontent.com\",\"registry.npmjs.org\",\"s.symcb.com\",\"s.symcd.com\",\"security.ubuntu.com\",\"telemetry.enterprise.githubcopilot.com\",\"ts-crl.ws.symantec.com\",\"ts-ocsp.ws.symantec.com\",\"www.googleapis.com\"],\"isolation\":true,\"topologyAttach\":[\"awmg-mcpg\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-5.4\",\"gpt-5.5\",\"gpt-5.6\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-3.6-flash\":[\"copilot/gemini-3.6*flash*\",\"google/gemini-3.6*flash*\",\"gemini/gemini-3.6*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"fable\",\"sonnet\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mai-code-1-flash-picker\":[\"copilot/MAI-Code-1-Flash-picker*\",\"copilot/mai-code-1-flash-picker*\",\"openai/MAI-Code-1-Flash-picker*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"raptor-mini\":[\"copilot/raptor*\",\"openai/raptor*\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-5*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\",\"anthropic/*sonnet-5*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.27.42,squid=sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0,agent=sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b,agent-act=sha256:a14ad974484aa518aab83d40f3f141175dfd171d3745e01c092375b970f73a20,api-proxy=sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607,cli-proxy=sha256:da006bf96d2d246dd269d57b233c1798d2ad63d6cd64ca02f7bf71045028781f\"},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
export GH_AW_MODELS_JSON_PATH="/tmp/gh-aw/models.json"
GH_AW_DOCKER_HOST=""
@@ -1075,7 +1085,7 @@ jobs:
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
GH_AW_TIMEOUT_MINUTES: 20
- GH_AW_VERSION: v0.82.14
+ GH_AW_VERSION: v0.83.4
GITHUB_API_URL: ${{ github.api_url }}
GITHUB_AW: true
GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows
@@ -1295,7 +1305,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -1304,8 +1314,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor — Merge Queue"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor-mq.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Download agent output artifact
id: download-agent-output
@@ -1496,6 +1506,7 @@ jobs:
GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168"
GH_AW_ENGINE_ID: "copilot"
GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }}
+ GH_AW_ENGINE_SECRET_FAILURE_MESSAGE: "**Alternative**: If your organization has a Copilot subscription, you can avoid the need for a personal access token by adding a top-level `permissions` block to your workflow file. This enables Copilot inference through the org using the built-in GitHub Actions token.\n\n```yaml\npermissions:\n copilot-requests: write\n```\n\nSee: https://github.github.com/gh-aw/reference/engines/#github-copilot-default"
GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens || '' }}
GH_AW_AI_CREDITS_RATE_LIMIT_ERROR: ${{ needs.agent.outputs.ai_credits_rate_limit_error || 'false' }}
@@ -1550,7 +1561,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -1559,8 +1570,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor — Merge Queue"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor-mq.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Download agent output artifact
id: download-agent-output
@@ -1578,7 +1589,7 @@ jobs:
echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
- name: Checkout repository for patch context
if: needs.agent.outputs.has_patch == 'true'
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# --- Threat Detection ---
@@ -1587,7 +1598,7 @@ jobs:
rm -rf /tmp/gh-aw/sandbox/firewall/logs
rm -rf /tmp/gh-aw/sandbox/firewall/audit
- name: Download container images
- run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.37@sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67 ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37@sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317 ghcr.io/github/gh-aw-firewall/squid:0.27.37@sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607 ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0
- name: Check if detection needed
id: detection_guard
if: always()
@@ -1650,11 +1661,11 @@ jobs:
node-version: '24'
package-manager-cache: false
- name: Install GitHub Copilot CLI
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.71
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.75
env:
GH_HOST: github.com
- name: Install AWF binary
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.37
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.42
- name: Execute GitHub Copilot CLI
if: always() && steps.detection_guard.outputs.run_detection == 'true'
continue-on-error: true
@@ -1664,7 +1675,7 @@ jobs:
run: |
set -o pipefail
printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
- trap 'rm -f "$HOME/.copilot/settings.json"' EXIT
+ trap 'gh_aw_exit_code=$?; mkdir -p /tmp/gh-aw >/dev/null 2>&1 || true; printf "%s" "$gh_aw_exit_code" > /tmp/gh-aw/agent_execution_exit_code.txt || true; rm -f "$HOME/.copilot/settings.json"' EXIT
mkdir -p "$HOME/.copilot"
printf '%s' '{"builtInAgents":{"rubberDuck":false}}' > "$HOME/.copilot/settings.json"
export XDG_CONFIG_HOME="$HOME"
@@ -1674,7 +1685,7 @@ jobs:
export COPILOT_API_KEY="$COPILOT_DUMMY_BYOK"
(umask 177 && touch /tmp/gh-aw/threat-detection/detection.log)
GH_AW_MAX_AI_CREDITS="${GH_AW_MAX_AI_CREDITS:-400}"
- printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.37/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"api.business.githubcopilot.com\",\"api.enterprise.githubcopilot.com\",\"api.github.com\",\"api.githubcopilot.com\",\"api.individual.githubcopilot.com\",\"github.com\",\"host.docker.internal\",\"registry.npmjs.org\",\"telemetry.enterprise.githubcopilot.com\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-5.4\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"fable\",\"sonnet\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mai-code-1-flash-picker\":[\"copilot/MAI-Code-1-Flash-picker*\",\"copilot/mai-code-1-flash-picker*\",\"openai/MAI-Code-1-Flash-picker*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.27.37,squid=sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b,agent=sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67,api-proxy=sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317,cli-proxy=sha256:1d5300d9b08e1c4f2ad1830860656a0656383a83280058f17e805a7c3ecda203\"},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
+ printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.42/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"api.business.githubcopilot.com\",\"api.enterprise.githubcopilot.com\",\"api.github.com\",\"api.githubcopilot.com\",\"api.individual.githubcopilot.com\",\"github.com\",\"host.docker.internal\",\"registry.npmjs.org\",\"telemetry.enterprise.githubcopilot.com\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-5.4\",\"gpt-5.5\",\"gpt-5.6\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-3.6-flash\":[\"copilot/gemini-3.6*flash*\",\"google/gemini-3.6*flash*\",\"gemini/gemini-3.6*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"fable\",\"sonnet\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mai-code-1-flash-picker\":[\"copilot/MAI-Code-1-Flash-picker*\",\"copilot/mai-code-1-flash-picker*\",\"openai/MAI-Code-1-Flash-picker*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"raptor-mini\":[\"copilot/raptor*\",\"openai/raptor*\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-5*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\",\"anthropic/*sonnet-5*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.27.42,squid=sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0,agent=sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b,agent-act=sha256:a14ad974484aa518aab83d40f3f141175dfd171d3745e01c092375b970f73a20,api-proxy=sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607,cli-proxy=sha256:da006bf96d2d246dd269d57b233c1798d2ad63d6cd64ca02f7bf71045028781f\"},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
export GH_AW_MODELS_JSON_PATH="/tmp/gh-aw/models.json"
GH_AW_DOCKER_HOST=""
@@ -1708,7 +1719,7 @@ jobs:
GH_AW_PHASE: detection
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
GH_AW_TIMEOUT_MINUTES: 20
- GH_AW_VERSION: v0.82.14
+ GH_AW_VERSION: v0.83.4
GITHUB_API_URL: ${{ github.api_url }}
GITHUB_AW: true
GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows
@@ -1791,102 +1802,23 @@ jobs:
with:
name: agent
path: ${{ runner.temp }}/gh-aw/safe-jobs/
+ - name: Checkout agentic-workflow scripts
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
+ with:
+ persist-credentials: false
+ sparse-checkout: .github/scripts/agentic-workflows
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # a309ff8b426b58ec0e2a45f0f869d46889d02405
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
+ with:
+ python-version: "3.13"
- name: Send Teams notification
run: |
- set -euo pipefail
-
- if [ -z "${TEAMS_WEBHOOK_URL:-}" ]; then
- echo "TEAMS_WEBHOOK_URL secret is not configured" >&2
- exit 1
- fi
-
- if [ ! -f "${GH_AW_AGENT_OUTPUT:-}" ]; then
- echo "No agent output found at GH_AW_AGENT_OUTPUT" >&2
- exit 1
- fi
-
- ITEM=$(jq -c '[.items[] | select(.type == "notify_teams")] | last' "$GH_AW_AGENT_OUTPUT")
- if [ -z "$ITEM" ] || [ "$ITEM" = "null" ]; then
- echo "No notify_teams item present in agent output" >&2
- exit 1
- fi
-
- TITLE=$(echo "$ITEM" | jq -r '.title // ""')
- FAILED_WORKFLOW=$(echo "$ITEM" | jq -r '.failed_workflow // ""')
- PIPELINE_URL=$(echo "$ITEM" | jq -r '.pipeline_url // ""')
- DESCRIPTION=$(echo "$ITEM" | jq -r '.description // ""')
- PR_NUMBER=$(echo "$ITEM" | jq -r '.pr_number // ""')
- PR_URL=$(echo "$ITEM" | jq -r '.pr_url // ""')
- AUTHOR=$(echo "$ITEM" | jq -r '.author // ""')
- DB_ENTRIES=$(echo "$ITEM" | jq -r '.db_entries // ""')
- OCCURRENCES=$(echo "$ITEM" | jq -r '.occurrence_count // ""')
- STATISTICS=$(echo "$ITEM" | jq -r '.statistics // ""')
- STATISTICS_JSON=$(echo "$ITEM" | jq -r '.statistics_json // ""')
-
- # Persist the full statistics database as a workflow artifact for offline review.
- STATS_DIR="${RUNNER_TEMP:-/tmp}/ci-doctor-mq-stats"
- mkdir -p "$STATS_DIR"
- if [ -n "$STATISTICS_JSON" ]; then
- # Validate and pretty-print; fall back to raw on parse error.
- if echo "$STATISTICS_JSON" | jq '.' > "$STATS_DIR/ci-doctor-mq-statistics.json" 2>/dev/null; then
- echo "Wrote validated statistics JSON ($(wc -c < "$STATS_DIR/ci-doctor-mq-statistics.json") bytes)"
- else
- echo "Warning: statistics_json failed jq parse; storing raw payload" >&2
- printf '%s' "$STATISTICS_JSON" > "$STATS_DIR/ci-doctor-mq-statistics.json"
- fi
- fi
- if [ -n "$STATISTICS" ]; then
- printf '%s\n' "$STATISTICS" > "$STATS_DIR/ci-doctor-mq-statistics.md"
- fi
- echo "stats_dir=$STATS_DIR" >> "$GITHUB_OUTPUT"
-
- # Build Adaptive Card facts conditionally (only include PR/author when present).
- FACTS=$(jq -nc \
- --arg pipeline_url "$PIPELINE_URL" \
- --arg pr_number "$PR_NUMBER" \
- --arg pr_url "$PR_URL" \
- --arg author "$AUTHOR" \
- --arg failed_workflow "$FAILED_WORKFLOW" \
- --arg db_entries "$DB_ENTRIES" \
- --arg occurrences "$OCCURRENCES" '
- [
- ( $failed_workflow | select(length > 0) | { title: "Workflow", value: . } ),
- ( $pipeline_url | select(length > 0) | { title: "Pipeline", value: ("[Open run](" + . + ")") } ),
- ( $pr_number | select(length > 0) | { title: "PR", value: (if ($pr_url | length) > 0 then ("[#" + . + "](" + $pr_url + ")") else ("#" + .) end) } ),
- ( $author | select(length > 0) | { title: "Author", value: ("@" + .) } ),
- ( $occurrences | select(length > 0) | { title: "Occurrences", value: (. + "×") } ),
- ( $db_entries | select(length > 0) | { title: "DB entries", value: . } )
- ] | map(select(. != null))')
-
- PAYLOAD=$(jq -nc \
- --arg title "$TITLE" \
- --arg description "$DESCRIPTION" \
- --arg statistics "$STATISTICS" \
- --argjson facts "$FACTS" '
- {
- type: "message",
- attachments: [{
- contentType: "application/vnd.microsoft.card.adaptive",
- content: {
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
- type: "AdaptiveCard",
- version: "1.4",
- body: ([
- { type: "TextBlock", text: ("\ud83d\udd34 [MQ] " + $title), weight: "Bolder", size: "Medium", color: "Attention", wrap: true },
- { type: "FactSet", facts: $facts },
- { type: "TextBlock", text: $description, wrap: true, spacing: "Medium" }
- ] + (if ($statistics | length) > 0 then [
- { type: "TextBlock", text: "Pattern Database Statistics", weight: "Bolder", size: "Medium", spacing: "Large", separator: true },
- { type: "TextBlock", text: $statistics, wrap: true, spacing: "Small" }
- ] else [] end))
- }
- }]
- }')
-
- curl -sS --fail-with-body \
- -H "Content-Type: application/json" \
- -d "$PAYLOAD" \
- "$TEAMS_WEBHOOK_URL"
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/notify_teams.py
env:
GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
RUN_URL: ${{ github.event.workflow_run.html_url || github.event.inputs.link || '' }}
@@ -1918,75 +1850,23 @@ jobs:
with:
name: agent
path: ${{ runner.temp }}/gh-aw/safe-jobs/
+ - name: Checkout agentic-workflow scripts
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
+ with:
+ persist-credentials: false
+ sparse-checkout: .github/scripts/agentic-workflows
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # a309ff8b426b58ec0e2a45f0f869d46889d02405
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
+ with:
+ python-version: "3.13"
- name: Send recurring failure escalation to Teams
run: |
- set -euo pipefail
-
- if [ -z "${TEAMS_WEBHOOK_URL:-}" ]; then
- echo "TEAMS_WEBHOOK_URL secret is not configured" >&2
- exit 1
- fi
-
- if [ ! -f "${GH_AW_AGENT_OUTPUT:-}" ]; then
- echo "No agent output found at GH_AW_AGENT_OUTPUT" >&2
- exit 1
- fi
-
- ITEM=$(jq -c '[.items[] | select(.type == "notify_teams_recurring")] | last' "$GH_AW_AGENT_OUTPUT")
- if [ -z "$ITEM" ] || [ "$ITEM" = "null" ]; then
- echo "No notify_teams_recurring item present in agent output" >&2
- exit 1
- fi
-
- TITLE=$(echo "$ITEM" | jq -r '.title // ""')
- FAILED_WORKFLOW=$(echo "$ITEM" | jq -r '.failed_workflow // ""')
- PIPELINE_URL=$(echo "$ITEM" | jq -r '.pipeline_url // ""')
- RECENT_COUNT=$(echo "$ITEM" | jq -r '.recent_count // ""')
- DESCRIPTION=$(echo "$ITEM" | jq -r '.description // ""')
- AFFECTED_PRS=$(echo "$ITEM" | jq -r '.affected_prs // ""')
- RECENT_RUNS=$(echo "$ITEM" | jq -r '.recent_run_urls // ""')
-
- FACTS=$(jq -nc \
- --arg failed_workflow "$FAILED_WORKFLOW" \
- --arg pipeline_url "$PIPELINE_URL" \
- --arg recent_count "$RECENT_COUNT" '
- [
- { title: "Workflow", value: $failed_workflow },
- { title: "Pipeline", value: ("[Latest run](" + $pipeline_url + ")") },
- { title: "Hits (last 12 hrs)", value: ($recent_count + " occurrences") }
- ]')
-
- PAYLOAD=$(jq -nc \
- --arg title "$TITLE" \
- --arg description "$DESCRIPTION" \
- --arg affected_prs "$AFFECTED_PRS" \
- --arg recent_runs "$RECENT_RUNS" \
- --argjson facts "$FACTS" '
- {
- type: "message",
- attachments: [{
- contentType: "application/vnd.microsoft.card.adaptive",
- content: {
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
- type: "AdaptiveCard",
- version: "1.4",
- body: [
- { type: "TextBlock", text: ("\ud83d\udd01 [MQ] Recurring Failure: " + $title), weight: "Bolder", size: "Medium", color: "Warning", wrap: true },
- { type: "FactSet", facts: $facts },
- { type: "TextBlock", text: $description, wrap: true, spacing: "Medium" },
- { type: "TextBlock", text: "### Affected PRs", weight: "Bolder", spacing: "Large", separator: true },
- { type: "TextBlock", text: $affected_prs, wrap: true, spacing: "Small" },
- { type: "TextBlock", text: "### Recent Failure Runs", weight: "Bolder", spacing: "Large", separator: true },
- { type: "TextBlock", text: $recent_runs, wrap: true, spacing: "Small" }
- ]
- }
- }]
- }')
-
- curl -sS --fail-with-body \
- -H "Content-Type: application/json" \
- -d "$PAYLOAD" \
- "$TEAMS_WEBHOOK_URL"
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/notify_teams_recurring.py
env:
GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
@@ -2006,15 +1886,15 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor — Merge Queue"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor-mq.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Check team membership for workflow
id: check_membership
@@ -2052,7 +1932,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -2061,11 +1941,11 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor — Merge Queue"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor-mq.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Checkout repository
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .
@@ -2111,6 +1991,7 @@ jobs:
if: (!cancelled()) && needs.agent.result != 'skipped' && contains(needs.agent.outputs.output_types, 'readd_to_merge_queue')
runs-on: ubuntu-latest
permissions:
+ contents: read
pull-requests: read
steps:
- name: Download agent output artifact
@@ -2119,107 +2000,27 @@ jobs:
with:
name: agent
path: ${{ runner.temp }}/gh-aw/safe-jobs/
+ - name: Checkout agentic-workflow scripts
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
+ with:
+ persist-credentials: false
+ sparse-checkout: .github/scripts/agentic-workflows
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # a309ff8b426b58ec0e2a45f0f869d46889d02405
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
+ with:
+ python-version: "3.13"
+ - name: Install PyGithub
+ run: python -m pip install --quiet PyGithub
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
- name: Re-add pull request to merge queue
run: |
- set -euo pipefail
- set +H # disable bash history expansion so literal "!" in MARKER/comments is safe to paste/test interactively
-
- MARKER="<!-- ci-doctor-mq-readd -->"
-
- if [ -z "${GH_TOKEN:-}" ]; then
- echo "MERGE_QUEUE_TOKEN secret is not configured; cannot re-add to merge queue." >&2
- exit 1
- fi
-
- if [ ! -f "${GH_AW_AGENT_OUTPUT:-}" ]; then
- echo "No agent output found at GH_AW_AGENT_OUTPUT" >&2
- exit 1
- fi
-
- ITEM=$(jq -c '[.items[] | select(.type == "readd_to_merge_queue")] | last' "$GH_AW_AGENT_OUTPUT")
- if [ -z "$ITEM" ] || [ "$ITEM" = "null" ]; then
- echo "No readd_to_merge_queue item present in agent output" >&2
- exit 1
- fi
-
- PR_NUMBER=$(echo "$ITEM" | jq -r '.pr_number // ""')
- REPOSITORY=$(echo "$ITEM" | jq -r '.repository // ""')
- REASON=$(echo "$ITEM" | jq -r '.reason // ""')
-
- # Validate pr_number is purely numeric to avoid API path/query injection.
- if ! printf '%s' "$PR_NUMBER" | grep -Eq '^[0-9]+$'; then
- echo "pr_number must be a numeric string, got: '$PR_NUMBER'" >&2
- exit 1
- fi
-
- # Fall back to the current repository when none was supplied.
- if [ -z "$REPOSITORY" ] || [ "$REPOSITORY" = "not_found" ]; then
- REPOSITORY="${GITHUB_REPOSITORY}"
- fi
-
- # Validate repository is in owner/repo form to avoid API path injection.
- if ! printf '%s' "$REPOSITORY" | grep -Eq '^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$'; then
- echo "repository must be in owner/repo format, got: '$REPOSITORY'" >&2
- exit 1
- fi
-
- echo "Requested re-add of PR #$PR_NUMBER in $REPOSITORY to merge queue (reason: $REASON)"
-
- # Loop guard: if CI Doctor already re-added this PR (marker comment
- # present), do not re-add again to avoid queue thrash.
- if gh pr view "$PR_NUMBER" --repo "$REPOSITORY" --json comments \
- --jq '.comments[].body' | grep -qF "$MARKER"; then
- echo "PR #$PR_NUMBER already re-added by CI Doctor (marker comment found); skipping."
- exit 0
- fi
-
- # Fetch PR state. Note: `gh pr view --json` does not expose merge-queue
- # membership, so this job does not re-check whether the PR is still in
- # the queue — that decision is made upstream by the agent (which only
- # calls this tool when the PR was dropped), and re-running `gh pr merge`
- # on an already-queued PR is safe.
- PR_INFO=$(gh pr view "$PR_NUMBER" --repo "$REPOSITORY" \
- --json state,isDraft,headRefOid)
-
- PR_STATE=$(echo "$PR_INFO" | jq -r '.state // ""')
- PR_DRAFT=$(echo "$PR_INFO" | jq -r '.isDraft // false')
- PR_HEAD=$(echo "$PR_INFO" | jq -r '.headRefOid // ""')
-
- # Only re-add an open, non-draft, unmerged PR.
- if [ "$PR_STATE" = "MERGED" ]; then
- echo "PR #$PR_NUMBER is already merged; nothing to re-add."
- exit 0
- fi
- if [ "$PR_STATE" != "OPEN" ]; then
- echo "PR #$PR_NUMBER is not open (state=$PR_STATE); not re-adding."
- exit 0
- fi
- if [ "$PR_DRAFT" = "true" ]; then
- echo "PR #$PR_NUMBER is a draft; not re-adding."
- exit 0
- fi
-
- # Re-add the PR to the merge queue. On a branch that requires a merge
- # queue, `gh pr merge` adds the PR to the queue (or enables auto-merge
- # if required checks are still pending) instead of merging directly,
- # using the queue's own configured merge method. A merge-method flag
- # (`--squash`) is still required so the CLI runs non-interactively
- # (otherwise it prompts / errors asking which method to use).
- # `--match-head-commit` guards against the head moving under us.
- if [ -n "$PR_HEAD" ]; then
- gh pr merge "$PR_NUMBER" --repo "$REPOSITORY" --squash --match-head-commit "$PR_HEAD"
- else
- gh pr merge "$PR_NUMBER" --repo "$REPOSITORY" --squash
- fi
-
- echo "Successfully requested re-add of PR #$PR_NUMBER to the merge queue."
-
- # Record a marker comment so subsequent CI Doctor runs do not re-add again.
- COMMENT_BODY=$(printf '%s\n\n_CI Doctor re-added this pull request to the merge queue after a transient failure (reason: %s)._' \
- "$MARKER" "$REASON")
- gh pr comment "$PR_NUMBER" --repo "$REPOSITORY" --body "$COMMENT_BODY"
-
- echo "Recorded re-add marker comment on PR #$PR_NUMBER."
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/readd_to_merge_queue.py
env:
GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
GH_TOKEN: ${{ secrets.MERGE_QUEUE_TOKEN }}
@@ -2232,6 +2033,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
actions: write
+ contents: read
steps:
- name: Download agent output artifact
continue-on-error: true
@@ -2239,59 +2041,27 @@ jobs:
with:
name: agent
path: ${{ runner.temp }}/gh-aw/safe-jobs/
+ - name: Checkout agentic-workflow scripts
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
+ with:
+ persist-credentials: false
+ sparse-checkout: .github/scripts/agentic-workflows
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # a309ff8b426b58ec0e2a45f0f869d46889d02405
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
+ with:
+ python-version: "3.13"
+ - name: Install PyGithub
+ run: python -m pip install --quiet PyGithub
+ env:
+ GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
- name: Re-run failed jobs
run: |
- set -euo pipefail
-
- if [ ! -f "${GH_AW_AGENT_OUTPUT:-}" ]; then
- echo "No agent output found at GH_AW_AGENT_OUTPUT" >&2
- exit 1
- fi
-
- ITEM=$(jq -c '[.items[] | select(.type == "rerun_failed_jobs")] | last' "$GH_AW_AGENT_OUTPUT")
- if [ -z "$ITEM" ] || [ "$ITEM" = "null" ]; then
- echo "No rerun_failed_jobs item present in agent output" >&2
- exit 1
- fi
-
- RUN_ID=$(echo "$ITEM" | jq -r '.run_id // ""')
- REPOSITORY=$(echo "$ITEM" | jq -r '.repository // ""')
- REASON=$(echo "$ITEM" | jq -r '.reason // ""')
-
- # Validate run_id is purely numeric to avoid API path injection.
- if ! printf '%s' "$RUN_ID" | grep -Eq '^[0-9]+$'; then
- echo "run_id must be a numeric string, got: '$RUN_ID'" >&2
- exit 1
- fi
-
- # Fall back to the current repository when none was supplied.
- if [ -z "$REPOSITORY" ] || [ "$REPOSITORY" = "not_found" ]; then
- REPOSITORY="${GITHUB_REPOSITORY}"
- fi
-
- # Validate repository is in owner/repo form to avoid API path injection.
- if ! printf '%s' "$REPOSITORY" | grep -Eq '^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$'; then
- echo "repository must be in owner/repo format, got: '$REPOSITORY'" >&2
- exit 1
- fi
-
- echo "Requested re-run of failed jobs for $REPOSITORY run $RUN_ID (reason: $REASON)"
-
- # Guard against restart loops: if the run has already been attempted
- # more than once, do not re-run it again (mirrors rerunner.py).
- ATTEMPT=$(gh api "repos/${REPOSITORY}/actions/runs/${RUN_ID}" --jq '.run_attempt')
- if [ "${ATTEMPT:-1}" -gt 1 ]; then
- echo "Run $RUN_ID already has $ATTEMPT attempts; not re-running to avoid loops."
- exit 0
- fi
-
- # Re-run ONLY the failed jobs of the analysed run.
- gh api \
- --method POST \
- -H "Accept: application/vnd.github+json" \
- "repos/${REPOSITORY}/actions/runs/${RUN_ID}/rerun-failed-jobs"
-
- echo "Successfully requested re-run of failed jobs for $REPOSITORY run $RUN_ID."
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/rerun_failed_jobs.py
env:
GH_AW_AGENT_OUTPUT: ${{ runner.temp }}/gh-aw/safe-jobs/agent_output.json
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -2318,7 +2088,7 @@ jobs:
GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }}
GH_AW_ENGINE_ID: "copilot"
GH_AW_ENGINE_MODEL: "claude-sonnet-4.6"
- GH_AW_ENGINE_VERSION: "1.0.71"
+ GH_AW_ENGINE_VERSION: "1.0.75"
GH_AW_RUNTIME_FEATURES: ${{ vars.GH_AW_RUNTIME_FEATURES }}
GH_AW_THREAT_DETECTION_AIC: ${{ needs.detection.outputs.aic }}
GH_AW_WORKFLOW_ID: "ci-doctor-mq"
@@ -2336,7 +2106,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -2345,8 +2115,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor — Merge Queue"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor-mq.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Download agent output artifact
id: download-agent-output
@@ -2387,7 +2157,7 @@ jobs:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io, getOctokit);
- const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs');
+ const { main } = require('${{ runner.temp }}/gh-aw/actions/process_safe_outputs.cjs');
await main();
- name: Upload Safe Outputs Items
if: always()
@@ -2397,4 +2167,6 @@ jobs:
path: |
/tmp/gh-aw/safe-output-items.jsonl
/tmp/gh-aw/temporary-id-map.json
+ /tmp/gh-aw/process-safe-outputs.stdout.log
+ /tmp/gh-aw/process-safe-outputs.stderr.log
if-no-files-found: ignore
diff --git a/.github/workflows/ci-doctor.lock.yml b/.github/workflows/ci-doctor.lock.yml
index 8920f36cfec..931826d6401 100644
--- a/.github/workflows/ci-doctor.lock.yml
+++ b/.github/workflows/ci-doctor.lock.yml
@@ -1,6 +1,6 @@
-# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"102ee59ba089b8f6917b8f51171c563233aba943d27da1bce4e9d92afebfaf1e","body_hash":"a6cc2a4ac576c7af73935a6cc80ed1430c0afb343a3315d40825980d05205d78","compiler_version":"v0.82.14","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6","engine_versions":{"copilot":"1.0.71"}}
-# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"b6d1443e05b8716267fa19425b99aa4f12006b4a","version":"v0.82.14"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.37","digest":"sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.37@sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37","digest":"sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37@sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.37","digest":"sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.37@sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.1","digest":"sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.1@sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.6.0","digest":"sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3","pinned_image":"ghcr.io/github/github-mcp-server:v1.6.0@sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3"}]}
-# This file was automatically generated by gh-aw (v0.82.14). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md
+# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"601670df52628f3a501a81a2be85b4dacfeee7b7236cba8876cb12a4e23e2a56","body_hash":"a6cc2a4ac576c7af73935a6cc80ed1430c0afb343a3315d40825980d05205d78","compiler_version":"v0.83.4","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.6","engine_versions":{"copilot":"1.0.75"}}
+# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"3d3c42e5aac5ba805825da76410c181273ba90b1","version":"v7.0.1"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"820762786026740c76f36085b0efc47a31fe5020","version":"v7.0.0"},{"repo":"actions/setup-python","sha":"a309ff8b426b58ec0e2a45f0f869d46889d02405","version":"a309ff8b426b58ec0e2a45f0f869d46889d02405"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"e89c65e17eb281bbd5ff2ff9e9199a03e96654c7","version":"v0.83.4"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42","digest":"sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42","digest":"sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42","digest":"sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.4.6","digest":"sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748","pinned_image":"ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748"},{"image":"ghcr.io/github/github-mcp-server:v1.7.0","digest":"sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308","pinned_image":"ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308"}]}
+# This file was automatically generated by gh-aw (v0.83.4). DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md
#
# ___ _ _
# / _ \ | | (_)
@@ -42,21 +42,22 @@
# Custom actions used:
# - actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
# - actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
-# - actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+# - actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 (source v9)
# - actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
+# - actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # a309ff8b426b58ec0e2a45f0f869d46889d02405
# - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
-# - github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+# - github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
#
# Container images used:
-# - ghcr.io/github/gh-aw-firewall/agent:0.27.37@sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67
-# - ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37@sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317
-# - ghcr.io/github/gh-aw-firewall/squid:0.27.37@sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b
-# - ghcr.io/github/gh-aw-mcpg:v0.4.1@sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32
-# - ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b
-# - ghcr.io/github/github-mcp-server:v1.6.0@sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3
+# - ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b
+# - ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607
+# - ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0
+# - ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c
+# - ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748
+# - ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308
name: "CI Failure Doctor"
on:
@@ -75,8 +76,7 @@ run-name: "CI Failure Doctor"
jobs:
activation:
needs: pre_activation
- if: >
- needs.pre_activation.outputs.activated == 'true' && (contains(fromJSON('["akashchi","mryzhov","akladiev","ababushk","dorloff","as-suvorov"]'), github.actor))
+ if: "needs.pre_activation.outputs.activated == 'true' && ((contains(fromJSON('[\"akashchi\",\"mryzhov\",\"akladiev\",\"ababushk\",\"dorloff\",\"as-suvorov\"]'), github.actor)) && (github.event_name == 'issue_comment' && (startsWith(github.event.comment.body, '/ci-doctor ') || startsWith(github.event.comment.body, '/ci-doctor\n') || github.event.comment.body == '/ci-doctor') && github.event.issue.pull_request != null))"
runs-on: ubuntu-slim
permissions:
actions: read
@@ -109,7 +109,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -119,8 +119,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Generate agentic run info
id: generate_aw_info
@@ -128,16 +128,16 @@ jobs:
GH_AW_INFO_ENGINE_ID: "copilot"
GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI"
GH_AW_INFO_MODEL: "claude-sonnet-4.6"
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AGENT_VERSION: "1.0.71"
- GH_AW_INFO_CLI_VERSION: "v0.82.14"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AGENT_VERSION: "1.0.75"
+ GH_AW_INFO_CLI_VERSION: "v0.83.4"
GH_AW_INFO_WORKFLOW_NAME: "CI Failure Doctor"
GH_AW_INFO_EXPERIMENTAL: "false"
GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true"
GH_AW_INFO_STAGED: "false"
GH_AW_INFO_ALLOWED_DOMAINS: '["defaults"]'
GH_AW_INFO_FIREWALL_ENABLED: "true"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_AWMG_VERSION: ""
GH_AW_INFO_FIREWALL_TYPE: "squid"
GH_AW_COMPILED_STRICT: "true"
@@ -218,7 +218,7 @@ jobs:
GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
- name: Checkout .github and .agents folders
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: |
@@ -253,7 +253,7 @@ jobs:
- name: Check compile-agentic version
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
- GH_AW_COMPILED_VERSION: "v0.82.14"
+ GH_AW_COMPILED_VERSION: "v0.83.4"
with:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
@@ -498,7 +498,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -507,8 +507,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Set runtime paths
id: set-runtime-paths
@@ -519,7 +519,7 @@ jobs:
echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json"
} >> "$GITHUB_OUTPUT"
- name: Checkout repository
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Create gh-aw temp directory
@@ -543,13 +543,21 @@ jobs:
MEMORY_DIR: /tmp/gh-aw/repo-memory/default
CREATE_ORPHAN: true
run: bash "${RUNNER_TEMP}/gh-aw/actions/clone_repo_memory_branch.sh"
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # a309ff8b426b58ec0e2a45f0f869d46889d02405
+ with:
+ python-version: "3.13"
+ - name: Install PyGithub
+ run: python -m pip install --quiet PyGithub
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.event.workflow_run.id || github.event.inputs.run_id }}
name: Download CI failure logs
- run: "set -e\nLOG_DIR=\"/tmp/gh-aw/agent/ci-doctor/logs\"\nFILTERED_DIR=\"/tmp/gh-aw/agent/ci-doctor/filtered\"\nSUMMARY_FILE=\"/tmp/gh-aw/agent/ci-doctor/summary.txt\"\nmkdir -p \"$LOG_DIR\" \"$FILTERED_DIR\"\n\n# Download the log for a single failed job and pre-locate error hints.\ndownload_job_log() {\n JOB_ID=\"$1\"\n LOG_FILE=\"$LOG_DIR/job-${JOB_ID}.log\"\n echo \"Downloading log for job $JOB_ID...\"\n gh api \"repos/$REPO/actions/jobs/$JOB_ID/logs\" > \"$LOG_FILE\" 2>/dev/null \\\n || echo \"(log download failed)\" > \"$LOG_FILE\"\n echo \" -> Saved $(wc -l < \"$LOG_FILE\") lines to $LOG_FILE\"\n\n HINTS_FILE=\"$FILTERED_DIR/job-${JOB_ID}-hints.txt\"\n grep -n -m 30 -iE \"(error[: ]|ERROR|FAIL|panic:|fatal[: ]|undefined[: ]|exception|exit status [^0])\" \\\n \"$LOG_FILE\" > \"$HINTS_FILE\" 2>/dev/null || true\n if [ -s \"$HINTS_FILE\" ]; then\n echo \" -> Pre-located $(wc -l < \"$HINTS_FILE\") hint line(s) in $HINTS_FILE\"\n fi\n}\n\n# Append the shared \"downloaded files\" + \"hint files\" footer to the summary.\nwrite_summary_footer() {\n echo \"\"\n echo \"Downloaded job log files ($LOG_DIR):\"\n for LOG_FILE in \"$LOG_DIR\"/job-*.log; do\n [ -f \"$LOG_FILE\" ] || continue\n echo \" $LOG_FILE ($(wc -l < \"$LOG_FILE\") lines)\"\n done\n echo \"\"\n echo \"Filtered hint files ($FILTERED_DIR):\"\n for HINTS_FILE in \"$FILTERED_DIR\"/*-hints.txt; do\n [ -s \"$HINTS_FILE\" ] || continue\n echo \" $HINTS_FILE ($(wc -l < \"$HINTS_FILE\") matches)\"\n head -3 \"$HINTS_FILE\" | sed 's/^/ /'\n done\n}\n\nif [ -n \"$RUN_ID\" ]; then\n # ---- run mode: a single workflow run (CI Doctor — Merge Queue) ----\n echo \"=== CI Doctor: Pre-downloading logs for run $RUN_ID ===\"\n\n gh api \"repos/$REPO/actions/runs/$RUN_ID/jobs\" \\\n --jq '[.jobs[] | select(.conclusion == \"failure\" or .conclusion == \"cancelled\") | {id:.id, name:.name, failed_steps:[.steps[]? | select(.conclusion==\"failure\") | .name]}]' \\\n > \"$LOG_DIR/failed-jobs.json\"\n\n FAILED_COUNT=$(jq 'length' \"$LOG_DIR/failed-jobs.json\")\n echo \"Found $FAILED_COUNT failed job(s)\"\n\n {\n echo \"=== CI Doctor Pre-Analysis ===\"\n echo \"Run ID: $RUN_ID\"\n echo \"\"\n echo \"Failed jobs (details in $LOG_DIR/failed-jobs.json):\"\n jq -r '.[] | \" Job \\(.id): \\(.name)\\n Failed steps: \\(.failed_steps | join(\", \"))\"' \\\n \"$LOG_DIR/failed-jobs.json\"\n } > \"$SUMMARY_FILE\"\n\n if [ \"$FAILED_COUNT\" -eq 0 ]; then\n echo \"No failed jobs found, skipping log download\"\n else\n cat \"$LOG_DIR/failed-jobs.json\"\n jq -r '.[].id' \"$LOG_DIR/failed-jobs.json\" | while read -r JOB_ID; do\n download_job_log \"$JOB_ID\"\n done\n fi\n\n write_summary_footer >> \"$SUMMARY_FILE\"\n\nelif [ -n \"$PR_NUMBER\" ]; then\n # ---- pr mode: every failed run on a pull request head commit ----\n echo \"=== CI Doctor: Pre-downloading logs for PR #$PR_NUMBER ===\"\n\n HEAD_SHA=$(gh api \"repos/$REPO/pulls/$PR_NUMBER\" --jq '.head.sha' 2>/dev/null || echo \"\")\n if [ -z \"$HEAD_SHA\" ]; then\n echo \"Could not resolve a pull request head SHA (is this a PR comment?), skipping log download\"\n echo \"No pull request context available.\" > \"$SUMMARY_FILE\"\n exit 0\n fi\n echo \"PR head SHA: $HEAD_SHA\"\n\n # Find all workflow runs for the PR head SHA that failed or were cancelled\n gh api --paginate \"repos/$REPO/actions/runs?head_sha=$HEAD_SHA\" \\\n --jq '[.workflow_runs[] | select(.conclusion == \"failure\" or .conclusion == \"cancelled\") | {id:.id, name:.name, url:.html_url, conclusion:.conclusion}]' \\\n > \"$LOG_DIR/failed-runs.json\" 2>/dev/null || echo '[]' > \"$LOG_DIR/failed-runs.json\"\n\n # De-duplicate by workflow name, keeping the most recent (highest id) run per workflow\n jq 'group_by(.name) | map(max_by(.id))' \"$LOG_DIR/failed-runs.json\" > \"$LOG_DIR/failed-runs.dedup.json\"\n mv \"$LOG_DIR/failed-runs.dedup.json\" \"$LOG_DIR/failed-runs.json\"\n\n FAILED_COUNT=$(jq 'length' \"$LOG_DIR/failed-runs.json\")\n echo \"Found $FAILED_COUNT failed pipeline(s) on PR #$PR_NUMBER\"\n\n {\n echo \"=== CI Doctor Pre-Analysis (PR #$PR_NUMBER, head $HEAD_SHA) ===\"\n echo \"\"\n echo \"Failed pipelines (details in $LOG_DIR/failed-runs.json):\"\n jq -r '.[] | \" Run \\(.id): \\(.name) [\\(.conclusion)] \\(.url)\"' \"$LOG_DIR/failed-runs.json\"\n } > \"$SUMMARY_FILE\"\n\n if [ \"$FAILED_COUNT\" -eq 0 ]; then\n echo \"No failed pipelines found, skipping log download\"\n else\n cat \"$LOG_DIR/failed-runs.json\"\n jq -r '.[].id' \"$LOG_DIR/failed-runs.json\" | while read -r RUN_ID; do\n gh api \"repos/$REPO/actions/runs/$RUN_ID/jobs\" \\\n --jq '[.jobs[] | select(.conclusion == \"failure\" or .conclusion == \"cancelled\") | {id:.id, name:.name, failed_steps:[.steps[]? | select(.conclusion==\"failure\") | .name]}]' \\\n > \"$LOG_DIR/run-${RUN_ID}-failed-jobs.json\" 2>/dev/null || echo '[]' > \"$LOG_DIR/run-${RUN_ID}-failed-jobs.json\"\n\n jq -r '.[].id' \"$LOG_DIR/run-${RUN_ID}-failed-jobs.json\" | while read -r JOB_ID; do\n download_job_log \"$JOB_ID\"\n done\n done\n fi\n\n write_summary_footer >> \"$SUMMARY_FILE\"\n\nelse\n echo \"Neither RUN_ID nor PR_NUMBER is set; nothing to pre-download.\"\n echo \"No CI Doctor context (no RUN_ID or PR_NUMBER).\" > \"$SUMMARY_FILE\"\nfi\n\necho \"\"\necho \"✅ Pre-analysis complete. Agent should start with $SUMMARY_FILE\"\n"
+ run: |
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/download_failure_logs.py
- name: Configure Git credentials
env:
@@ -572,11 +580,11 @@ jobs:
const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs');
await main();
- name: Install GitHub Copilot CLI
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.71
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.75
env:
GH_HOST: github.com
- name: Install AWF binary
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.37 --rootless
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.42 --rootless
- name: Determine automatic lockdown mode for GitHub MCP Server
id: determine-automatic-lockdown
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 (source v9)
@@ -603,7 +611,7 @@ jobs:
GH_AW_SKILL_DIR: ".github/skills"
run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_inline_skills.sh"
- name: Download container images
- run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.37@sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67 ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37@sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317 ghcr.io/github/gh-aw-firewall/squid:0.27.37@sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b ghcr.io/github/gh-aw-mcpg:v0.4.1@sha256:ad2a979c2cd8b50098e84938ca9c9c1580eb8e91526f101a90adfba7859b2c32 ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b ghcr.io/github/github-mcp-server:v1.6.0@sha256:2b0c48b070f61e9d3969269ead600f62d00fb237b60ac849ef3d166ee7de9ad3
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607 ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0 ghcr.io/github/gh-aw-mcpg:v0.4.6@sha256:fecabec51bbc41f2ad61076d6bcd9a36ef23b142e672a444e054d37fc29de93c ghcr.io/github/gh-aw-node@sha256:a8082161d7dceda14b68f32eb39d0eaa96b825d07f5895b096afab9d9e0c7748 ghcr.io/github/github-mcp-server:v1.7.0@sha256:c491ffdf6f4c85cb5397021bc655edb8ab825c6f5f568e7597d77a1bd7c4d308
- name: Generate Safe Outputs Config
run: |
mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs"
@@ -758,16 +766,16 @@ jobs:
MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0')
MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0')
source "${RUNNER_TEMP}/gh-aw/actions/resolve_docker_socket_gid.sh"
- export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network bridge -p 127.0.0.1:'"${MCP_GATEWAY_PORT}"':'"${MCP_GATEWAY_PORT}"' --name awmg-mcpg --add-host host.docker.internal:host-gateway --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DOCKER_HOST=unix:///var/run/docker.sock -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_POLICY_ALLOW_CREATE_PULL_REQUEST -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e RUNNER_TEMP -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw -v '"${RUNNER_TEMP}"'/gh-aw/safeoutputs:'"${RUNNER_TEMP}"'/gh-aw/safeoutputs:rw ghcr.io/github/gh-aw-mcpg:v0.4.1'
+ export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network bridge -p 127.0.0.1:'"${MCP_GATEWAY_PORT}"':'"${MCP_GATEWAY_PORT}"' --name awmg-mcpg --add-host host.docker.internal:host-gateway --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DOCKER_HOST=unix:///var/run/docker.sock -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_POLICY_ALLOW_CREATE_PULL_REQUEST -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e RUNNER_TEMP -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw -v '"${RUNNER_TEMP}"'/gh-aw/safeoutputs:'"${RUNNER_TEMP}"'/gh-aw/safeoutputs:rw ghcr.io/github/gh-aw-mcpg:v0.4.6'
mkdir -p "$HOME/.copilot"
GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node)
- cat << GH_AW_MCP_CONFIG_aa7b5de0d299165b_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
+ cat << GH_AW_MCP_CONFIG_bcbb445f12830b86_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
{
"mcpServers": {
"github": {
"type": "stdio",
- "container": "ghcr.io/github/github-mcp-server:v1.6.0",
+ "container": "ghcr.io/github/github-mcp-server:v1.7.0",
"env": {
"GITHUB_FEATURES": "fields_param",
"GITHUB_HOST": "${GITHUB_SERVER_URL}",
@@ -824,7 +832,7 @@ jobs:
"startupTimeout": 120
}
}
- GH_AW_MCP_CONFIG_aa7b5de0d299165b_EOF
+ GH_AW_MCP_CONFIG_bcbb445f12830b86_EOF
- name: Mount MCP servers as CLIs
id: mount-mcp-clis
continue-on-error: true
@@ -853,7 +861,7 @@ jobs:
run: |
set -o pipefail
printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
- trap 'rm -f "$HOME/.copilot/settings.json"' EXIT
+ trap 'gh_aw_exit_code=$?; mkdir -p /tmp/gh-aw >/dev/null 2>&1 || true; printf "%s" "$gh_aw_exit_code" > /tmp/gh-aw/agent_execution_exit_code.txt || true; rm -f "$HOME/.copilot/settings.json"' EXIT
mkdir -p "$HOME/.copilot"
printf '%s' '{"builtInAgents":{"rubberDuck":false}}' > "$HOME/.copilot/settings.json"
export XDG_CONFIG_HOME="$HOME"
@@ -864,7 +872,7 @@ jobs:
export COPILOT_API_KEY="$COPILOT_DUMMY_BYOK"
(umask 177 && touch /tmp/gh-aw/agent-stdio.log)
GH_AW_MAX_AI_CREDITS="${GH_AW_MAX_AI_CREDITS:-1000}"
- printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.37/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"api.business.githubcopilot.com\",\"api.enterprise.githubcopilot.com\",\"api.github.com\",\"api.githubcopilot.com\",\"api.individual.githubcopilot.com\",\"api.snapcraft.io\",\"archive.ubuntu.com\",\"azure.archive.ubuntu.com\",\"crl.geotrust.com\",\"crl.globalsign.com\",\"crl.identrust.com\",\"crl.sectigo.com\",\"crl.thawte.com\",\"crl.usertrust.com\",\"crl.verisign.com\",\"crl3.digicert.com\",\"crl4.digicert.com\",\"crls.ssl.com\",\"github.com\",\"host.docker.internal\",\"json-schema.org\",\"json.schemastore.org\",\"keyserver.ubuntu.com\",\"ocsp.digicert.com\",\"ocsp.geotrust.com\",\"ocsp.globalsign.com\",\"ocsp.identrust.com\",\"ocsp.sectigo.com\",\"ocsp.ssl.com\",\"ocsp.thawte.com\",\"ocsp.usertrust.com\",\"ocsp.verisign.com\",\"packagecloud.io\",\"packages.cloud.google.com\",\"packages.microsoft.com\",\"ppa.launchpad.net\",\"raw.githubusercontent.com\",\"registry.npmjs.org\",\"s.symcb.com\",\"s.symcd.com\",\"security.ubuntu.com\",\"telemetry.enterprise.githubcopilot.com\",\"ts-crl.ws.symantec.com\",\"ts-ocsp.ws.symantec.com\",\"www.googleapis.com\"],\"isolation\":true,\"topologyAttach\":[\"awmg-mcpg\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-5.4\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"fable\",\"sonnet\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mai-code-1-flash-picker\":[\"copilot/MAI-Code-1-Flash-picker*\",\"copilot/mai-code-1-flash-picker*\",\"openai/MAI-Code-1-Flash-picker*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.27.37,squid=sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b,agent=sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67,api-proxy=sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317,cli-proxy=sha256:1d5300d9b08e1c4f2ad1830860656a0656383a83280058f17e805a7c3ecda203\"},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
+ printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.42/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"api.business.githubcopilot.com\",\"api.enterprise.githubcopilot.com\",\"api.github.com\",\"api.githubcopilot.com\",\"api.individual.githubcopilot.com\",\"api.snapcraft.io\",\"archive.ubuntu.com\",\"azure.archive.ubuntu.com\",\"crl.geotrust.com\",\"crl.globalsign.com\",\"crl.identrust.com\",\"crl.sectigo.com\",\"crl.thawte.com\",\"crl.usertrust.com\",\"crl.verisign.com\",\"crl3.digicert.com\",\"crl4.digicert.com\",\"crls.ssl.com\",\"github.com\",\"host.docker.internal\",\"json-schema.org\",\"json.schemastore.org\",\"keyserver.ubuntu.com\",\"ocsp.digicert.com\",\"ocsp.geotrust.com\",\"ocsp.globalsign.com\",\"ocsp.identrust.com\",\"ocsp.sectigo.com\",\"ocsp.ssl.com\",\"ocsp.thawte.com\",\"ocsp.usertrust.com\",\"ocsp.verisign.com\",\"packagecloud.io\",\"packages.cloud.google.com\",\"packages.microsoft.com\",\"ppa.launchpad.net\",\"raw.githubusercontent.com\",\"registry.npmjs.org\",\"s.symcb.com\",\"s.symcd.com\",\"security.ubuntu.com\",\"telemetry.enterprise.githubcopilot.com\",\"ts-crl.ws.symantec.com\",\"ts-ocsp.ws.symantec.com\",\"www.googleapis.com\"],\"isolation\":true,\"topologyAttach\":[\"awmg-mcpg\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-5.4\",\"gpt-5.5\",\"gpt-5.6\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-3.6-flash\":[\"copilot/gemini-3.6*flash*\",\"google/gemini-3.6*flash*\",\"gemini/gemini-3.6*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"fable\",\"sonnet\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mai-code-1-flash-picker\":[\"copilot/MAI-Code-1-Flash-picker*\",\"copilot/mai-code-1-flash-picker*\",\"openai/MAI-Code-1-Flash-picker*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"raptor-mini\":[\"copilot/raptor*\",\"openai/raptor*\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-5*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\",\"anthropic/*sonnet-5*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.27.42,squid=sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0,agent=sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b,agent-act=sha256:a14ad974484aa518aab83d40f3f141175dfd171d3745e01c092375b970f73a20,api-proxy=sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607,cli-proxy=sha256:da006bf96d2d246dd269d57b233c1798d2ad63d6cd64ca02f7bf71045028781f\"},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
export GH_AW_MODELS_JSON_PATH="/tmp/gh-aw/models.json"
GH_AW_DOCKER_HOST=""
@@ -897,7 +905,7 @@ jobs:
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }}
GH_AW_TIMEOUT_MINUTES: 20
- GH_AW_VERSION: v0.82.14
+ GH_AW_VERSION: v0.83.4
GITHUB_API_URL: ${{ github.api_url }}
GITHUB_AW: true
GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows
@@ -1103,7 +1111,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -1112,8 +1120,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Download agent output artifact
id: download-agent-output
@@ -1304,6 +1312,7 @@ jobs:
GH_AW_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168"
GH_AW_ENGINE_ID: "copilot"
GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }}
+ GH_AW_ENGINE_SECRET_FAILURE_MESSAGE: "**Alternative**: If your organization has a Copilot subscription, you can avoid the need for a personal access token by adding a top-level `permissions` block to your workflow file. This enables Copilot inference through the org using the built-in GitHub Actions token.\n\n```yaml\npermissions:\n copilot-requests: write\n```\n\nSee: https://github.github.com/gh-aw/reference/engines/#github-copilot-default"
GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens || '' }}
GH_AW_AI_CREDITS_RATE_LIMIT_ERROR: ${{ needs.agent.outputs.ai_credits_rate_limit_error || 'false' }}
@@ -1380,7 +1389,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -1389,8 +1398,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Download agent output artifact
id: download-agent-output
@@ -1408,7 +1417,7 @@ jobs:
echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT"
- name: Checkout repository for patch context
if: needs.agent.outputs.has_patch == 'true'
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# --- Threat Detection ---
@@ -1417,7 +1426,7 @@ jobs:
rm -rf /tmp/gh-aw/sandbox/firewall/logs
rm -rf /tmp/gh-aw/sandbox/firewall/audit
- name: Download container images
- run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.37@sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67 ghcr.io/github/gh-aw-firewall/api-proxy:0.27.37@sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317 ghcr.io/github/gh-aw-firewall/squid:0.27.37@sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.27.42@sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b ghcr.io/github/gh-aw-firewall/api-proxy:0.27.42@sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607 ghcr.io/github/gh-aw-firewall/squid:0.27.42@sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0
- name: Check if detection needed
id: detection_guard
if: always()
@@ -1480,11 +1489,11 @@ jobs:
node-version: '24'
package-manager-cache: false
- name: Install GitHub Copilot CLI
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.71
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.75
env:
GH_HOST: github.com
- name: Install AWF binary
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.37
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.42
- name: Execute GitHub Copilot CLI
if: always() && steps.detection_guard.outputs.run_detection == 'true'
continue-on-error: true
@@ -1494,7 +1503,7 @@ jobs:
run: |
set -o pipefail
printf '%s' "$(date +%s%3N)" > /tmp/gh-aw/agent_cli_start_ms.txt
- trap 'rm -f "$HOME/.copilot/settings.json"' EXIT
+ trap 'gh_aw_exit_code=$?; mkdir -p /tmp/gh-aw >/dev/null 2>&1 || true; printf "%s" "$gh_aw_exit_code" > /tmp/gh-aw/agent_execution_exit_code.txt || true; rm -f "$HOME/.copilot/settings.json"' EXIT
mkdir -p "$HOME/.copilot"
printf '%s' '{"builtInAgents":{"rubberDuck":false}}' > "$HOME/.copilot/settings.json"
export XDG_CONFIG_HOME="$HOME"
@@ -1504,7 +1513,7 @@ jobs:
export COPILOT_API_KEY="$COPILOT_DUMMY_BYOK"
(umask 177 && touch /tmp/gh-aw/threat-detection/detection.log)
GH_AW_MAX_AI_CREDITS="${GH_AW_MAX_AI_CREDITS:-400}"
- printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.37/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"api.business.githubcopilot.com\",\"api.enterprise.githubcopilot.com\",\"api.github.com\",\"api.githubcopilot.com\",\"api.individual.githubcopilot.com\",\"github.com\",\"host.docker.internal\",\"registry.npmjs.org\",\"telemetry.enterprise.githubcopilot.com\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-5.4\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"fable\",\"sonnet\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mai-code-1-flash-picker\":[\"copilot/MAI-Code-1-Flash-picker*\",\"copilot/mai-code-1-flash-picker*\",\"openai/MAI-Code-1-Flash-picker*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.27.37,squid=sha256:5abc51995e5901c5d1daeefc957301ee409980e2e607391ec22c06cb2513327b,agent=sha256:0d35e8682845f183c1c634699a8e8a6cbe2c271b867031410df74533243c5f67,api-proxy=sha256:fc2970aadaeae05993e76697d29f03dc8bfb9248ff87a8f3d8b0975485a4b317,cli-proxy=sha256:1d5300d9b08e1c4f2ad1830860656a0656383a83280058f17e805a7c3ecda203\"},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
+ printf '%s\n' "{\"\$schema\":\"https://github.com/github/gh-aw-firewall/releases/download/v0.27.42/awf-config.schema.json\",\"network\":{\"allowDomains\":[\"api.business.githubcopilot.com\",\"api.enterprise.githubcopilot.com\",\"api.github.com\",\"api.githubcopilot.com\",\"api.individual.githubcopilot.com\",\"github.com\",\"host.docker.internal\",\"registry.npmjs.org\",\"telemetry.enterprise.githubcopilot.com\"]},\"apiProxy\":{\"enabled\":true,\"enableTokenSteering\":true,\"maxRuns\":500,\"maxAiCredits\":${GH_AW_MAX_AI_CREDITS},\"maxCacheMisses\":5,\"models\":{\"agent\":[\"sonnet-6x\",\"gpt-5.4\",\"gpt-5.5\",\"gpt-5.6\",\"gpt-5.3\",\"gemini-pro\",\"any\"],\"antigravity\":[\"copilot/antigravity*\",\"google/antigravity*\",\"gemini/antigravity*\"],\"any\":[\"copilot/*\",\"anthropic/*\",\"openai/*\",\"google/*\",\"gemini/*\"],\"claude\":[\"agent\"],\"codex\":[\"agent\"],\"coding\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\",\"gpt-5-codex\",\"kimi\"],\"computer-use\":[\"copilot/*computer-use*\",\"google/*computer-use*\",\"gemini/*computer-use*\",\"openai/*computer-use*\"],\"copilot\":[\"agent\"],\"deep-research\":[\"copilot/deep-research*\",\"copilot/o3-deep-research*\",\"copilot/o4-mini-deep-research*\",\"google/deep-research*\",\"gemini/deep-research*\",\"openai/o3-deep-research*\",\"openai/o4-mini-deep-research*\"],\"fable\":[\"copilot/*fable*\",\"anthropic/*fable*\"],\"gemini\":[\"agent\"],\"gemini-3-flash\":[\"copilot/gemini-3*flash*\",\"google/gemini-3*flash*\",\"gemini/gemini-3*flash*\"],\"gemini-3-pro\":[\"copilot/gemini-3*pro*\",\"google/gemini-3*pro*\",\"google/nano-banana*\",\"gemini/gemini-3*pro*\"],\"gemini-3.1-flash\":[\"copilot/gemini-3.1*flash*\",\"google/gemini-3.1*flash*\",\"gemini/gemini-3.1*flash*\"],\"gemini-3.1-pro\":[\"copilot/gemini-3.1*pro*\",\"google/gemini-3.1*pro*\",\"gemini/gemini-3.1*pro*\"],\"gemini-3.5-flash\":[\"copilot/gemini-3.5*flash*\",\"google/gemini-3.5*flash*\",\"gemini/gemini-3.5*flash*\"],\"gemini-3.6-flash\":[\"copilot/gemini-3.6*flash*\",\"google/gemini-3.6*flash*\",\"gemini/gemini-3.6*flash*\"],\"gemini-flash\":[\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"],\"gemini-flash-lite\":[\"copilot/gemini-*flash*lite*\",\"google/gemini-*flash*lite*\",\"gemini/gemini-*flash*lite*\"],\"gemini-omni\":[\"copilot/gemini-omni*\",\"google/gemini-omni*\",\"gemini/gemini-omni*\"],\"gemini-pro\":[\"copilot/gemini-*pro*\",\"google/gemini-*pro*\",\"gemini/gemini-*pro*\"],\"gemma\":[\"copilot/gemma*\",\"google/gemma*\",\"gemini/gemma*\"],\"gpt-5\":[\"copilot/gpt-5*\",\"openai/gpt-5*\"],\"gpt-5-codex\":[\"copilot/gpt-5*codex*\",\"openai/gpt-5*codex*\"],\"gpt-5-mini\":[\"copilot/gpt-5*mini*\",\"openai/gpt-5*mini*\"],\"gpt-5-nano\":[\"copilot/gpt-5*nano*\",\"openai/gpt-5*nano*\"],\"gpt-5-pro\":[\"copilot/gpt-5*pro*\",\"openai/gpt-5*pro*\"],\"gpt-5.1\":[\"copilot/gpt-5.1*\",\"openai/gpt-5.1*\"],\"gpt-5.2\":[\"copilot/gpt-5.2*\",\"openai/gpt-5.2*\"],\"gpt-5.3\":[\"copilot/gpt-5.3*\",\"openai/gpt-5.3*\"],\"gpt-5.4\":[\"copilot/gpt-5.4*\",\"openai/gpt-5.4*\"],\"gpt-5.5\":[\"copilot/gpt-5.5*\",\"openai/gpt-5.5*\"],\"gpt-5.6\":[\"copilot/gpt-5.6*\",\"openai/gpt-5.6*\"],\"haiku\":[\"copilot/*haiku*\",\"anthropic/*haiku*\"],\"image-generation\":[\"copilot/gpt-image*\",\"openai/gpt-image*\",\"openai/chatgpt-image*\",\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"google/imagen*\"],\"kimi\":[\"copilot/kimi*\",\"openai/kimi*\"],\"kiwi\":[\"copilot/kiwi*\",\"openai/kiwi*\"],\"large\":[\"fable\",\"sonnet\",\"gpt-5-pro\",\"gpt-5\",\"gemini-pro\"],\"lyria\":[\"google/lyria*\",\"gemini/lyria*\",\"copilot/lyria*\"],\"mai-code\":[\"copilot/MAI-Code*\",\"copilot/mai-code*\",\"openai/MAI-Code*\"],\"mai-code-1-flash-picker\":[\"copilot/MAI-Code-1-Flash-picker*\",\"copilot/mai-code-1-flash-picker*\",\"openai/MAI-Code-1-Flash-picker*\"],\"mini\":[\"haiku\",\"gpt-5-mini\",\"gpt-5-nano\",\"gemini-flash-lite\"],\"nano-banana\":[\"copilot/nano-banana*\",\"google/nano-banana*\",\"gemini/nano-banana*\"],\"opus\":[\"copilot/*opus*\",\"anthropic/*opus*\"],\"opusplan\":[\"opus?effort=high\"],\"raptor-mini\":[\"copilot/raptor*\",\"openai/raptor*\"],\"reasoning\":[\"copilot/o1*\",\"copilot/o3*\",\"copilot/o4*\",\"openai/o1*\",\"openai/o3*\",\"openai/o4*\"],\"robotics\":[\"copilot/*robotics*\",\"google/*robotics*\",\"gemini/*robotics*\"],\"small\":[\"mini\"],\"small-agent\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash\"],\"sonnet\":[\"copilot/*sonnet*\",\"anthropic/*sonnet*\"],\"sonnet-6x\":[\"copilot/*sonnet-4.5*\",\"copilot/*sonnet-4.6*\",\"copilot/*sonnet-5*\",\"copilot/*sonnet-4-5-*\",\"anthropic/*sonnet-4-5-*\",\"copilot/*sonnet-4-6*\",\"anthropic/*sonnet-4-6*\",\"anthropic/*sonnet-5*\"],\"summarization\":[\"haiku\",\"gpt-5-mini\",\"gemini-flash-lite\",\"mini\"],\"veo\":[\"google/veo*\",\"gemini/veo*\"],\"vision\":[\"copilot/gemini-*image*\",\"google/gemini-*image*\",\"gemini/gemini-*image*\",\"copilot/gemini-*flash*\",\"google/gemini-*flash*\",\"gemini/gemini-*flash*\"]}},\"container\":{\"imageTag\":\"0.27.42,squid=sha256:42dfeb649c680a8558cd5423dbc530b653a69413e35ffbe5e71da5d48c94bdf0,agent=sha256:26a8af4e5566485b02f52af59ee03803ae798271a9619d4767e94d07806deb9b,agent-act=sha256:a14ad974484aa518aab83d40f3f141175dfd171d3745e01c092375b970f73a20,api-proxy=sha256:944f2686c9ab9bec338fd14b662461662f77cd12cd0ea8a3e7cb8c0987cd1607,cli-proxy=sha256:da006bf96d2d246dd269d57b233c1798d2ad63d6cd64ca02f7bf71045028781f\"},\"logging\":{\"proxyLogsDir\":\"/tmp/gh-aw/sandbox/firewall/logs\",\"auditDir\":\"/tmp/gh-aw/sandbox/firewall/audit\"}}" > "${RUNNER_TEMP}/gh-aw/awf-config.json"
cp "${RUNNER_TEMP}/gh-aw/awf-config.json" /tmp/gh-aw/awf-config.json
export GH_AW_MODELS_JSON_PATH="/tmp/gh-aw/models.json"
GH_AW_DOCKER_HOST=""
@@ -1538,7 +1547,7 @@ jobs:
GH_AW_PHASE: detection
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
GH_AW_TIMEOUT_MINUTES: 20
- GH_AW_VERSION: v0.82.14
+ GH_AW_VERSION: v0.83.4
GITHUB_API_URL: ${{ github.api_url }}
GITHUB_AW: true
GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows
@@ -1607,9 +1616,7 @@ jobs:
}
pre_activation:
- if: >
- (github.event_name != 'issue_comment' || contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) &&
- (contains(fromJSON('["akashchi","mryzhov","akladiev","ababushk","dorloff","as-suvorov"]'), github.actor))
+ if: "(github.event_name != 'issue_comment' || contains(fromJSON('[\"OWNER\",\"MEMBER\",\"COLLABORATOR\"]'), github.event.comment.author_association)) && ((contains(fromJSON('[\"akashchi\",\"mryzhov\",\"akladiev\",\"ababushk\",\"dorloff\",\"as-suvorov\"]'), github.actor)) && (github.event_name == 'issue_comment' && (startsWith(github.event.comment.body, '/ci-doctor ') || startsWith(github.event.comment.body, '/ci-doctor\n') || github.event.comment.body == '/ci-doctor') && github.event.issue.pull_request != null))"
runs-on: ubuntu-slim
env:
GH_AW_RUNTIME_FEATURES: ${{ vars.GH_AW_RUNTIME_FEATURES }}
@@ -1622,15 +1629,15 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Check team membership for command workflow
id: check_membership
@@ -1679,7 +1686,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -1688,11 +1695,11 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Checkout repository
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .
@@ -1754,7 +1761,7 @@ jobs:
GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }}
GH_AW_ENGINE_ID: "copilot"
GH_AW_ENGINE_MODEL: "claude-sonnet-4.6"
- GH_AW_ENGINE_VERSION: "1.0.71"
+ GH_AW_ENGINE_VERSION: "1.0.75"
GH_AW_RUNTIME_FEATURES: ${{ vars.GH_AW_RUNTIME_FEATURES }}
GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e Generated by [{workflow_name}]({run_url})\"}"
GH_AW_THREAT_DETECTION_AIC: ${{ needs.detection.outputs.aic }}
@@ -1773,7 +1780,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@b6d1443e05b8716267fa19425b99aa4f12006b4a # v0.82.14
+ uses: github/gh-aw-actions/setup@e89c65e17eb281bbd5ff2ff9e9199a03e96654c7 # v0.83.4
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -1782,8 +1789,8 @@ jobs:
env:
GH_AW_SETUP_WORKFLOW_NAME: "CI Failure Doctor"
GH_AW_CURRENT_WORKFLOW_REF: ${{ github.repository }}/.github/workflows/ci-doctor.lock.yml@${{ github.ref }}
- GH_AW_INFO_VERSION: "1.0.71"
- GH_AW_INFO_AWF_VERSION: "v0.27.37"
+ GH_AW_INFO_VERSION: "1.0.75"
+ GH_AW_INFO_AWF_VERSION: "v0.27.42"
GH_AW_INFO_ENGINE_ID: "copilot"
- name: Download agent output artifact
id: download-agent-output
@@ -1823,7 +1830,7 @@ jobs:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io, getOctokit);
- const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs');
+ const { main } = require('${{ runner.temp }}/gh-aw/actions/process_safe_outputs.cjs');
await main();
- name: Upload Safe Outputs Items
if: always()
@@ -1833,4 +1840,6 @@ jobs:
path: |
/tmp/gh-aw/safe-output-items.jsonl
/tmp/gh-aw/temporary-id-map.json
+ /tmp/gh-aw/process-safe-outputs.stdout.log
+ /tmp/gh-aw/process-safe-outputs.stderr.log
if-no-files-found: ignore
diff --git a/.github/workflows/shared/agentic-workflows/download-failure-logs.md b/.github/workflows/shared/agentic-workflows/download-failure-logs.md
index c5da96c3b3a..3292d2899ae 100644
--- a/.github/workflows/shared/agentic-workflows/download-failure-logs.md
+++ b/.github/workflows/shared/agentic-workflows/download-failure-logs.md
@@ -15,6 +15,12 @@ description: |
Run mode additionally writes logs/failed-jobs.json; PR mode additionally writes
logs/failed-runs.json and logs/run-<run-id>-failed-jobs.json.
steps:
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: '3.13'
+ - name: Install PyGithub
+ run: python -m pip install --quiet PyGithub
- name: Download CI failure logs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -22,132 +28,8 @@ steps:
PR_NUMBER: ${{ github.event.issue.number }}
RUN_ID: ${{ github.event.workflow_run.id || github.event.inputs.run_id }}
run: |
- set -e
- LOG_DIR="/tmp/gh-aw/agent/ci-doctor/logs"
- FILTERED_DIR="/tmp/gh-aw/agent/ci-doctor/filtered"
- SUMMARY_FILE="/tmp/gh-aw/agent/ci-doctor/summary.txt"
- mkdir -p "$LOG_DIR" "$FILTERED_DIR"
-
- # Download the log for a single failed job and pre-locate error hints.
- download_job_log() {
- JOB_ID="$1"
- LOG_FILE="$LOG_DIR/job-${JOB_ID}.log"
- echo "Downloading log for job $JOB_ID..."
- gh api "repos/$REPO/actions/jobs/$JOB_ID/logs" > "$LOG_FILE" 2>/dev/null \
- || echo "(log download failed)" > "$LOG_FILE"
- echo " -> Saved $(wc -l < "$LOG_FILE") lines to $LOG_FILE"
-
- HINTS_FILE="$FILTERED_DIR/job-${JOB_ID}-hints.txt"
- grep -n -m 30 -iE "(error[: ]|ERROR|FAIL|panic:|fatal[: ]|undefined[: ]|exception|exit status [^0])" \
- "$LOG_FILE" > "$HINTS_FILE" 2>/dev/null || true
- if [ -s "$HINTS_FILE" ]; then
- echo " -> Pre-located $(wc -l < "$HINTS_FILE") hint line(s) in $HINTS_FILE"
- fi
- }
-
- # Append the shared "downloaded files" + "hint files" footer to the summary.
- write_summary_footer() {
- echo ""
- echo "Downloaded job log files ($LOG_DIR):"
- for LOG_FILE in "$LOG_DIR"/job-*.log; do
- [ -f "$LOG_FILE" ] || continue
- echo " $LOG_FILE ($(wc -l < "$LOG_FILE") lines)"
- done
- echo ""
- echo "Filtered hint files ($FILTERED_DIR):"
- for HINTS_FILE in "$FILTERED_DIR"/*-hints.txt; do
- [ -s "$HINTS_FILE" ] || continue
- echo " $HINTS_FILE ($(wc -l < "$HINTS_FILE") matches)"
- head -3 "$HINTS_FILE" | sed 's/^/ /'
- done
- }
-
- if [ -n "$RUN_ID" ]; then
- # ---- run mode: a single workflow run (CI Doctor — Merge Queue) ----
- echo "=== CI Doctor: Pre-downloading logs for run $RUN_ID ==="
-
- gh api "repos/$REPO/actions/runs/$RUN_ID/jobs" \
- --jq '[.jobs[] | select(.conclusion == "failure" or .conclusion == "cancelled") | {id:.id, name:.name, failed_steps:[.steps[]? | select(.conclusion=="failure") | .name]}]' \
- > "$LOG_DIR/failed-jobs.json"
-
- FAILED_COUNT=$(jq 'length' "$LOG_DIR/failed-jobs.json")
- echo "Found $FAILED_COUNT failed job(s)"
-
- {
- echo "=== CI Doctor Pre-Analysis ==="
- echo "Run ID: $RUN_ID"
- echo ""
- echo "Failed jobs (details in $LOG_DIR/failed-jobs.json):"
- jq -r '.[] | " Job \(.id): \(.name)\n Failed steps: \(.failed_steps | join(", "))"' \
- "$LOG_DIR/failed-jobs.json"
- } > "$SUMMARY_FILE"
-
- if [ "$FAILED_COUNT" -eq 0 ]; then
- echo "No failed jobs found, skipping log download"
- else
- cat "$LOG_DIR/failed-jobs.json"
- jq -r '.[].id' "$LOG_DIR/failed-jobs.json" | while read -r JOB_ID; do
- download_job_log "$JOB_ID"
- done
- fi
-
- write_summary_footer >> "$SUMMARY_FILE"
-
- elif [ -n "$PR_NUMBER" ]; then
- # ---- pr mode: every failed run on a pull request head commit ----
- echo "=== CI Doctor: Pre-downloading logs for PR #$PR_NUMBER ==="
-
- HEAD_SHA=$(gh api "repos/$REPO/pulls/$PR_NUMBER" --jq '.head.sha' 2>/dev/null || echo "")
- if [ -z "$HEAD_SHA" ]; then
- echo "Could not resolve a pull request head SHA (is this a PR comment?), skipping log download"
- echo "No pull request context available." > "$SUMMARY_FILE"
- exit 0
- fi
- echo "PR head SHA: $HEAD_SHA"
-
- # Find all workflow runs for the PR head SHA that failed or were cancelled
- gh api --paginate "repos/$REPO/actions/runs?head_sha=$HEAD_SHA" \
- --jq '[.workflow_runs[] | select(.conclusion == "failure" or .conclusion == "cancelled") | {id:.id, name:.name, url:.html_url, conclusion:.conclusion}]' \
- > "$LOG_DIR/failed-runs.json" 2>/dev/null || echo '[]' > "$LOG_DIR/failed-runs.json"
-
- # De-duplicate by workflow name, keeping the most recent (highest id) run per workflow
- jq 'group_by(.name) | map(max_by(.id))' "$LOG_DIR/failed-runs.json" > "$LOG_DIR/failed-runs.dedup.json"
- mv "$LOG_DIR/failed-runs.dedup.json" "$LOG_DIR/failed-runs.json"
-
- FAILED_COUNT=$(jq 'length' "$LOG_DIR/failed-runs.json")
- echo "Found $FAILED_COUNT failed pipeline(s) on PR #$PR_NUMBER"
-
- {
- echo "=== CI Doctor Pre-Analysis (PR #$PR_NUMBER, head $HEAD_SHA) ==="
- echo ""
- echo "Failed pipelines (details in $LOG_DIR/failed-runs.json):"
- jq -r '.[] | " Run \(.id): \(.name) [\(.conclusion)] \(.url)"' "$LOG_DIR/failed-runs.json"
- } > "$SUMMARY_FILE"
-
- if [ "$FAILED_COUNT" -eq 0 ]; then
- echo "No failed pipelines found, skipping log download"
- else
- cat "$LOG_DIR/failed-runs.json"
- jq -r '.[].id' "$LOG_DIR/failed-runs.json" | while read -r RUN_ID; do
- gh api "repos/$REPO/actions/runs/$RUN_ID/jobs" \
- --jq '[.jobs[] | select(.conclusion == "failure" or .conclusion == "cancelled") | {id:.id, name:.name, failed_steps:[.steps[]? | select(.conclusion=="failure") | .name]}]' \
- > "$LOG_DIR/run-${RUN_ID}-failed-jobs.json" 2>/dev/null || echo '[]' > "$LOG_DIR/run-${RUN_ID}-failed-jobs.json"
-
- jq -r '.[].id' "$LOG_DIR/run-${RUN_ID}-failed-jobs.json" | while read -r JOB_ID; do
- download_job_log "$JOB_ID"
- done
- done
- fi
-
- write_summary_footer >> "$SUMMARY_FILE"
-
- else
- echo "Neither RUN_ID nor PR_NUMBER is set; nothing to pre-download."
- echo "No CI Doctor context (no RUN_ID or PR_NUMBER)." > "$SUMMARY_FILE"
- fi
-
- echo ""
- echo "✅ Pre-analysis complete. Agent should start with $SUMMARY_FILE"
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/download_failure_logs.py
---
<!--
diff --git a/.github/workflows/shared/agentic-workflows/notify-teams-recurring.md b/.github/workflows/shared/agentic-workflows/notify-teams-recurring.md
index 06b72cf4355..a2bd53d85e7 100644
--- a/.github/workflows/shared/agentic-workflows/notify-teams-recurring.md
+++ b/.github/workflows/shared/agentic-workflows/notify-teams-recurring.md
@@ -40,77 +40,21 @@ safe-outputs:
required: true
type: string
steps:
+ - name: Checkout agentic-workflow scripts
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ with:
+ sparse-checkout: .github/scripts/agentic-workflows
+ persist-credentials: false
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: '3.13'
- name: Send recurring failure escalation to Teams
env:
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
run: |
- set -euo pipefail
-
- if [ -z "${TEAMS_WEBHOOK_URL:-}" ]; then
- echo "TEAMS_WEBHOOK_URL secret is not configured" >&2
- exit 1
- fi
-
- if [ ! -f "${GH_AW_AGENT_OUTPUT:-}" ]; then
- echo "No agent output found at GH_AW_AGENT_OUTPUT" >&2
- exit 1
- fi
-
- ITEM=$(jq -c '[.items[] | select(.type == "notify_teams_recurring")] | last' "$GH_AW_AGENT_OUTPUT")
- if [ -z "$ITEM" ] || [ "$ITEM" = "null" ]; then
- echo "No notify_teams_recurring item present in agent output" >&2
- exit 1
- fi
-
- TITLE=$(echo "$ITEM" | jq -r '.title // ""')
- FAILED_WORKFLOW=$(echo "$ITEM" | jq -r '.failed_workflow // ""')
- PIPELINE_URL=$(echo "$ITEM" | jq -r '.pipeline_url // ""')
- RECENT_COUNT=$(echo "$ITEM" | jq -r '.recent_count // ""')
- DESCRIPTION=$(echo "$ITEM" | jq -r '.description // ""')
- AFFECTED_PRS=$(echo "$ITEM" | jq -r '.affected_prs // ""')
- RECENT_RUNS=$(echo "$ITEM" | jq -r '.recent_run_urls // ""')
-
- FACTS=$(jq -nc \
- --arg failed_workflow "$FAILED_WORKFLOW" \
- --arg pipeline_url "$PIPELINE_URL" \
- --arg recent_count "$RECENT_COUNT" '
- [
- { title: "Workflow", value: $failed_workflow },
- { title: "Pipeline", value: ("[Latest run](" + $pipeline_url + ")") },
- { title: "Hits (last 12 hrs)", value: ($recent_count + " occurrences") }
- ]')
-
- PAYLOAD=$(jq -nc \
- --arg title "$TITLE" \
- --arg description "$DESCRIPTION" \
- --arg affected_prs "$AFFECTED_PRS" \
- --arg recent_runs "$RECENT_RUNS" \
- --argjson facts "$FACTS" '
- {
- type: "message",
- attachments: [{
- contentType: "application/vnd.microsoft.card.adaptive",
- content: {
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
- type: "AdaptiveCard",
- version: "1.4",
- body: [
- { type: "TextBlock", text: ("\ud83d\udd01 [MQ] Recurring Failure: " + $title), weight: "Bolder", size: "Medium", color: "Warning", wrap: true },
- { type: "FactSet", facts: $facts },
- { type: "TextBlock", text: $description, wrap: true, spacing: "Medium" },
- { type: "TextBlock", text: "### Affected PRs", weight: "Bolder", spacing: "Large", separator: true },
- { type: "TextBlock", text: $affected_prs, wrap: true, spacing: "Small" },
- { type: "TextBlock", text: "### Recent Failure Runs", weight: "Bolder", spacing: "Large", separator: true },
- { type: "TextBlock", text: $recent_runs, wrap: true, spacing: "Small" }
- ]
- }
- }]
- }')
-
- curl -sS --fail-with-body \
- -H "Content-Type: application/json" \
- -d "$PAYLOAD" \
- "$TEAMS_WEBHOOK_URL"
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/notify_teams_recurring.py
---
# CI Doctor MQ — Recurring Teams Notification Job
diff --git a/.github/workflows/shared/agentic-workflows/notify-teams.md b/.github/workflows/shared/agentic-workflows/notify-teams.md
index 9a36e5292d7..1b764d025b0 100644
--- a/.github/workflows/shared/agentic-workflows/notify-teams.md
+++ b/.github/workflows/shared/agentic-workflows/notify-teams.md
@@ -59,105 +59,22 @@ safe-outputs:
required: true
type: string
steps:
+ - name: Checkout agentic-workflow scripts
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ with:
+ sparse-checkout: .github/scripts/agentic-workflows
+ persist-credentials: false
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: '3.13'
- name: Send Teams notification
env:
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
RUN_URL: ${{ github.event.workflow_run.html_url || github.event.inputs.link || '' }}
run: |
- set -euo pipefail
-
- if [ -z "${TEAMS_WEBHOOK_URL:-}" ]; then
- echo "TEAMS_WEBHOOK_URL secret is not configured" >&2
- exit 1
- fi
-
- if [ ! -f "${GH_AW_AGENT_OUTPUT:-}" ]; then
- echo "No agent output found at GH_AW_AGENT_OUTPUT" >&2
- exit 1
- fi
-
- ITEM=$(jq -c '[.items[] | select(.type == "notify_teams")] | last' "$GH_AW_AGENT_OUTPUT")
- if [ -z "$ITEM" ] || [ "$ITEM" = "null" ]; then
- echo "No notify_teams item present in agent output" >&2
- exit 1
- fi
-
- TITLE=$(echo "$ITEM" | jq -r '.title // ""')
- FAILED_WORKFLOW=$(echo "$ITEM" | jq -r '.failed_workflow // ""')
- PIPELINE_URL=$(echo "$ITEM" | jq -r '.pipeline_url // ""')
- DESCRIPTION=$(echo "$ITEM" | jq -r '.description // ""')
- PR_NUMBER=$(echo "$ITEM" | jq -r '.pr_number // ""')
- PR_URL=$(echo "$ITEM" | jq -r '.pr_url // ""')
- AUTHOR=$(echo "$ITEM" | jq -r '.author // ""')
- DB_ENTRIES=$(echo "$ITEM" | jq -r '.db_entries // ""')
- OCCURRENCES=$(echo "$ITEM" | jq -r '.occurrence_count // ""')
- STATISTICS=$(echo "$ITEM" | jq -r '.statistics // ""')
- STATISTICS_JSON=$(echo "$ITEM" | jq -r '.statistics_json // ""')
-
- # Persist the full statistics database as a workflow artifact for offline review.
- STATS_DIR="${RUNNER_TEMP:-/tmp}/ci-doctor-mq-stats"
- mkdir -p "$STATS_DIR"
- if [ -n "$STATISTICS_JSON" ]; then
- # Validate and pretty-print; fall back to raw on parse error.
- if echo "$STATISTICS_JSON" | jq '.' > "$STATS_DIR/ci-doctor-mq-statistics.json" 2>/dev/null; then
- echo "Wrote validated statistics JSON ($(wc -c < "$STATS_DIR/ci-doctor-mq-statistics.json") bytes)"
- else
- echo "Warning: statistics_json failed jq parse; storing raw payload" >&2
- printf '%s' "$STATISTICS_JSON" > "$STATS_DIR/ci-doctor-mq-statistics.json"
- fi
- fi
- if [ -n "$STATISTICS" ]; then
- printf '%s\n' "$STATISTICS" > "$STATS_DIR/ci-doctor-mq-statistics.md"
- fi
- echo "stats_dir=$STATS_DIR" >> "$GITHUB_OUTPUT"
-
- # Build Adaptive Card facts conditionally (only include PR/author when present).
- FACTS=$(jq -nc \
- --arg pipeline_url "$PIPELINE_URL" \
- --arg pr_number "$PR_NUMBER" \
- --arg pr_url "$PR_URL" \
- --arg author "$AUTHOR" \
- --arg failed_workflow "$FAILED_WORKFLOW" \
- --arg db_entries "$DB_ENTRIES" \
- --arg occurrences "$OCCURRENCES" '
- [
- ( $failed_workflow | select(length > 0) | { title: "Workflow", value: . } ),
- ( $pipeline_url | select(length > 0) | { title: "Pipeline", value: ("[Open run](" + . + ")") } ),
- ( $pr_number | select(length > 0) | { title: "PR", value: (if ($pr_url | length) > 0 then ("[#" + . + "](" + $pr_url + ")") else ("#" + .) end) } ),
- ( $author | select(length > 0) | { title: "Author", value: ("@" + .) } ),
- ( $occurrences | select(length > 0) | { title: "Occurrences", value: (. + "×") } ),
- ( $db_entries | select(length > 0) | { title: "DB entries", value: . } )
- ] | map(select(. != null))')
-
- PAYLOAD=$(jq -nc \
- --arg title "$TITLE" \
- --arg description "$DESCRIPTION" \
- --arg statistics "$STATISTICS" \
- --argjson facts "$FACTS" '
- {
- type: "message",
- attachments: [{
- contentType: "application/vnd.microsoft.card.adaptive",
- content: {
- "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
- type: "AdaptiveCard",
- version: "1.4",
- body: ([
- { type: "TextBlock", text: ("\ud83d\udd34 [MQ] " + $title), weight: "Bolder", size: "Medium", color: "Attention", wrap: true },
- { type: "FactSet", facts: $facts },
- { type: "TextBlock", text: $description, wrap: true, spacing: "Medium" }
- ] + (if ($statistics | length) > 0 then [
- { type: "TextBlock", text: "Pattern Database Statistics", weight: "Bolder", size: "Medium", spacing: "Large", separator: true },
- { type: "TextBlock", text: $statistics, wrap: true, spacing: "Small" }
- ] else [] end))
- }
- }]
- }')
-
- curl -sS --fail-with-body \
- -H "Content-Type: application/json" \
- -d "$PAYLOAD" \
- "$TEAMS_WEBHOOK_URL"
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/notify_teams.py
- name: Upload statistics artifact
if: always()
diff --git a/.github/workflows/shared/agentic-workflows/readd-to-merge-queue.md b/.github/workflows/shared/agentic-workflows/readd-to-merge-queue.md
index 58f0e5f951b..1970f9e2609 100644
--- a/.github/workflows/shared/agentic-workflows/readd-to-merge-queue.md
+++ b/.github/workflows/shared/agentic-workflows/readd-to-merge-queue.md
@@ -12,6 +12,7 @@ safe-outputs:
output: "Re-add to merge queue requested for the affected pull request."
permissions:
pull-requests: read
+ contents: read
inputs:
pr_number:
description: "Number of the pull request that was dropped from the merge queue and should be re-added. Report as a numeric string."
@@ -27,6 +28,17 @@ safe-outputs:
required: true
type: string
steps:
+ - name: Checkout agentic-workflow scripts
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ with:
+ sparse-checkout: .github/scripts/agentic-workflows
+ persist-credentials: false
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: '3.13'
+ - name: Install PyGithub
+ run: python -m pip install --quiet PyGithub
- name: Re-add pull request to merge queue
env:
# A PAT or GitHub App token with `contents: write` and
@@ -35,105 +47,8 @@ safe-outputs:
# start new workflow runs), so the re-queued PR would stall.
GH_TOKEN: ${{ secrets.MERGE_QUEUE_TOKEN }}
run: |
- set -euo pipefail
- set +H # disable bash history expansion so literal "!" in MARKER/comments is safe to paste/test interactively
-
- MARKER="<!-- ci-doctor-mq-readd -->"
-
- if [ -z "${GH_TOKEN:-}" ]; then
- echo "MERGE_QUEUE_TOKEN secret is not configured; cannot re-add to merge queue." >&2
- exit 1
- fi
-
- if [ ! -f "${GH_AW_AGENT_OUTPUT:-}" ]; then
- echo "No agent output found at GH_AW_AGENT_OUTPUT" >&2
- exit 1
- fi
-
- ITEM=$(jq -c '[.items[] | select(.type == "readd_to_merge_queue")] | last' "$GH_AW_AGENT_OUTPUT")
- if [ -z "$ITEM" ] || [ "$ITEM" = "null" ]; then
- echo "No readd_to_merge_queue item present in agent output" >&2
- exit 1
- fi
-
- PR_NUMBER=$(echo "$ITEM" | jq -r '.pr_number // ""')
- REPOSITORY=$(echo "$ITEM" | jq -r '.repository // ""')
- REASON=$(echo "$ITEM" | jq -r '.reason // ""')
-
- # Validate pr_number is purely numeric to avoid API path/query injection.
- if ! printf '%s' "$PR_NUMBER" | grep -Eq '^[0-9]+$'; then
- echo "pr_number must be a numeric string, got: '$PR_NUMBER'" >&2
- exit 1
- fi
-
- # Fall back to the current repository when none was supplied.
- if [ -z "$REPOSITORY" ] || [ "$REPOSITORY" = "not_found" ]; then
- REPOSITORY="${GITHUB_REPOSITORY}"
- fi
-
- # Validate repository is in owner/repo form to avoid API path injection.
- if ! printf '%s' "$REPOSITORY" | grep -Eq '^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$'; then
- echo "repository must be in owner/repo format, got: '$REPOSITORY'" >&2
- exit 1
- fi
-
- echo "Requested re-add of PR #$PR_NUMBER in $REPOSITORY to merge queue (reason: $REASON)"
-
- # Loop guard: if CI Doctor already re-added this PR (marker comment
- # present), do not re-add again to avoid queue thrash.
- if gh pr view "$PR_NUMBER" --repo "$REPOSITORY" --json comments \
- --jq '.comments[].body' | grep -qF "$MARKER"; then
- echo "PR #$PR_NUMBER already re-added by CI Doctor (marker comment found); skipping."
- exit 0
- fi
-
- # Fetch PR state. Note: `gh pr view --json` does not expose merge-queue
- # membership, so this job does not re-check whether the PR is still in
- # the queue — that decision is made upstream by the agent (which only
- # calls this tool when the PR was dropped), and re-running `gh pr merge`
- # on an already-queued PR is safe.
- PR_INFO=$(gh pr view "$PR_NUMBER" --repo "$REPOSITORY" \
- --json state,isDraft,headRefOid)
-
- PR_STATE=$(echo "$PR_INFO" | jq -r '.state // ""')
- PR_DRAFT=$(echo "$PR_INFO" | jq -r '.isDraft // false')
- PR_HEAD=$(echo "$PR_INFO" | jq -r '.headRefOid // ""')
-
- # Only re-add an open, non-draft, unmerged PR.
- if [ "$PR_STATE" = "MERGED" ]; then
- echo "PR #$PR_NUMBER is already merged; nothing to re-add."
- exit 0
- fi
- if [ "$PR_STATE" != "OPEN" ]; then
- echo "PR #$PR_NUMBER is not open (state=$PR_STATE); not re-adding."
- exit 0
- fi
- if [ "$PR_DRAFT" = "true" ]; then
- echo "PR #$PR_NUMBER is a draft; not re-adding."
- exit 0
- fi
-
- # Re-add the PR to the merge queue. On a branch that requires a merge
- # queue, `gh pr merge` adds the PR to the queue (or enables auto-merge
- # if required checks are still pending) instead of merging directly,
- # using the queue's own configured merge method. A merge-method flag
- # (`--squash`) is still required so the CLI runs non-interactively
- # (otherwise it prompts / errors asking which method to use).
- # `--match-head-commit` guards against the head moving under us.
- if [ -n "$PR_HEAD" ]; then
- gh pr merge "$PR_NUMBER" --repo "$REPOSITORY" --squash --match-head-commit "$PR_HEAD"
- else
- gh pr merge "$PR_NUMBER" --repo "$REPOSITORY" --squash
- fi
-
- echo "Successfully requested re-add of PR #$PR_NUMBER to the merge queue."
-
- # Record a marker comment so subsequent CI Doctor runs do not re-add again.
- COMMENT_BODY=$(printf '%s\n\n_CI Doctor re-added this pull request to the merge queue after a transient failure (reason: %s)._' \
- "$MARKER" "$REASON")
- gh pr comment "$PR_NUMBER" --repo "$REPOSITORY" --body "$COMMENT_BODY"
-
- echo "Recorded re-add marker comment on PR #$PR_NUMBER."
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/readd_to_merge_queue.py
---
# CI Doctor MQ — Re-add Pull Request to Merge Queue
diff --git a/.github/workflows/shared/agentic-workflows/rerun-failed-jobs.md b/.github/workflows/shared/agentic-workflows/rerun-failed-jobs.md
index 676e6dc25c2..f0200fc042c 100644
--- a/.github/workflows/shared/agentic-workflows/rerun-failed-jobs.md
+++ b/.github/workflows/shared/agentic-workflows/rerun-failed-jobs.md
@@ -11,6 +11,7 @@ safe-outputs:
output: "Failed jobs re-run requested for the analysed workflow run."
permissions:
actions: write
+ contents: read
inputs:
run_id:
description: "Numeric ID of the GitHub Actions workflow run whose failed jobs should be re-run. This is the run that was investigated (github.event.workflow_run.id for merge-queue triggers, or the run_id input for workflow_dispatch). Report as a numeric string."
@@ -26,61 +27,23 @@ safe-outputs:
required: true
type: string
steps:
+ - name: Checkout agentic-workflow scripts
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ with:
+ sparse-checkout: .github/scripts/agentic-workflows
+ persist-credentials: false
+ - name: Set up Python
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
+ with:
+ python-version: '3.13'
+ - name: Install PyGithub
+ run: python -m pip install --quiet PyGithub
- name: Re-run failed jobs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- set -euo pipefail
-
- if [ ! -f "${GH_AW_AGENT_OUTPUT:-}" ]; then
- echo "No agent output found at GH_AW_AGENT_OUTPUT" >&2
- exit 1
- fi
-
- ITEM=$(jq -c '[.items[] | select(.type == "rerun_failed_jobs")] | last' "$GH_AW_AGENT_OUTPUT")
- if [ -z "$ITEM" ] || [ "$ITEM" = "null" ]; then
- echo "No rerun_failed_jobs item present in agent output" >&2
- exit 1
- fi
-
- RUN_ID=$(echo "$ITEM" | jq -r '.run_id // ""')
- REPOSITORY=$(echo "$ITEM" | jq -r '.repository // ""')
- REASON=$(echo "$ITEM" | jq -r '.reason // ""')
-
- # Validate run_id is purely numeric to avoid API path injection.
- if ! printf '%s' "$RUN_ID" | grep -Eq '^[0-9]+$'; then
- echo "run_id must be a numeric string, got: '$RUN_ID'" >&2
- exit 1
- fi
-
- # Fall back to the current repository when none was supplied.
- if [ -z "$REPOSITORY" ] || [ "$REPOSITORY" = "not_found" ]; then
- REPOSITORY="${GITHUB_REPOSITORY}"
- fi
-
- # Validate repository is in owner/repo form to avoid API path injection.
- if ! printf '%s' "$REPOSITORY" | grep -Eq '^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$'; then
- echo "repository must be in owner/repo format, got: '$REPOSITORY'" >&2
- exit 1
- fi
-
- echo "Requested re-run of failed jobs for $REPOSITORY run $RUN_ID (reason: $REASON)"
-
- # Guard against restart loops: if the run has already been attempted
- # more than once, do not re-run it again (mirrors rerunner.py).
- ATTEMPT=$(gh api "repos/${REPOSITORY}/actions/runs/${RUN_ID}" --jq '.run_attempt')
- if [ "${ATTEMPT:-1}" -gt 1 ]; then
- echo "Run $RUN_ID already has $ATTEMPT attempts; not re-running to avoid loops."
- exit 0
- fi
-
- # Re-run ONLY the failed jobs of the analysed run.
- gh api \
- --method POST \
- -H "Accept: application/vnd.github+json" \
- "repos/${REPOSITORY}/actions/runs/${RUN_ID}/rerun-failed-jobs"
-
- echo "Successfully requested re-run of failed jobs for $REPOSITORY run $RUN_ID."
+ export PYTHONPATH=.github/scripts/agentic-workflows/:${PYTHONPATH}
+ python .github/scripts/agentic-workflows/rerun_failed_jobs.py
---
# CI Doctor MQ — Re-run Failed Jobs