From 23a6280c02f2616ed899c1d5ae1af24e3eb459bf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:39:12 +0000 Subject: [PATCH 1/2] Initial plan From 0239153515d52dba06de12ad68107005acfb83b3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:50:11 +0000 Subject: [PATCH 2/2] Add explicit noop when no jobs have failed in detective workflows When the PR Actions Detective or Branch Actions Detective runs against a workflow run that has no failed jobs, the agent now calls noop instead of posting a comment or creating an issue. This prevents noisy output on successful runs. Fixes: Noop on no failure Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com> --- .github/workflows/gh-aw-branch-actions-detective.lock.yml | 3 ++- .github/workflows/gh-aw-branch-actions-detective.md | 1 + .github/workflows/gh-aw-pr-actions-detective.lock.yml | 3 ++- .github/workflows/gh-aw-pr-actions-detective.md | 1 + .github/workflows/gh-aw-pr-ci-detective.lock.yml | 3 ++- gh-agent-workflows/branch-actions-detective/README.md | 1 + gh-agent-workflows/pr-actions-detective/README.md | 1 + 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gh-aw-branch-actions-detective.lock.yml b/.github/workflows/gh-aw-branch-actions-detective.lock.yml index a684d2a8..010507ee 100644 --- a/.github/workflows/gh-aw-branch-actions-detective.lock.yml +++ b/.github/workflows/gh-aw-branch-actions-detective.lock.yml @@ -37,7 +37,7 @@ # # inlined-imports: true # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"4698c5df5e82f9afbef0009e358219a46b66356bd178b5a7b4a8f16ba27467ba"} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"c39066096793c814006c0318fb064abf1e9b5f36c344d2d0264f8b1b06880ac6"} name: "Branch Actions Detective" "on": @@ -339,6 +339,7 @@ jobs: gh api repos/__GH_AW_GITHUB_REPOSITORY__/actions/runs/{run_id}/jobs \ --jq '.jobs[] | {id: .id, name: .name, conclusion: .conclusion, html_url: .html_url}' ```` + - If none of the jobs have a `failure` conclusion, call `noop` with message "No failed jobs in workflow run; nothing to report" and stop. - Download logs to `/tmp/gh-aw/agent/` and inspect the failing step output: ````bash gh api repos/__GH_AW_GITHUB_REPOSITORY__/actions/runs/{run_id}/logs \ diff --git a/.github/workflows/gh-aw-branch-actions-detective.md b/.github/workflows/gh-aw-branch-actions-detective.md index aa41ec2a..3b363719 100644 --- a/.github/workflows/gh-aw-branch-actions-detective.md +++ b/.github/workflows/gh-aw-branch-actions-detective.md @@ -109,6 +109,7 @@ Analyze failed GitHub Actions CI runs on protected branches (e.g. `main`) in ${{ gh api repos/${{ github.repository }}/actions/runs/{run_id}/jobs \ --jq '.jobs[] | {id: .id, name: .name, conclusion: .conclusion, html_url: .html_url}' ```` + - If none of the jobs have a `failure` conclusion, call `noop` with message "No failed jobs in workflow run; nothing to report" and stop. - Download logs to `/tmp/gh-aw/agent/` and inspect the failing step output: ````bash gh api repos/${{ github.repository }}/actions/runs/{run_id}/logs \ diff --git a/.github/workflows/gh-aw-pr-actions-detective.lock.yml b/.github/workflows/gh-aw-pr-actions-detective.lock.yml index 1bf636cd..9fdae8a3 100644 --- a/.github/workflows/gh-aw-pr-actions-detective.lock.yml +++ b/.github/workflows/gh-aw-pr-actions-detective.lock.yml @@ -36,7 +36,7 @@ # # inlined-imports: true # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"d589e9e92dd79580cfa87ca119b5a0069b7f150690deb67875ebc174d1f63400"} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"8ca49070112f3c71d739dd15e34cdf1512eec4e0634ac25101ca170a10e428f5"} name: "PR Actions Detective" "on": @@ -325,6 +325,7 @@ jobs: gh api repos/__GH_AW_GITHUB_REPOSITORY__/actions/runs/{run_id}/jobs \ --jq '.jobs[] | {id: .id, name: .name, conclusion: .conclusion, html_url: .html_url}' ``` + - If none of the jobs have a `failure` conclusion, call `noop` with message "No failed jobs in workflow run; nothing to report" and stop. - Download logs to `/tmp/gh-aw/agent/` and inspect the failing step output: ```bash gh api repos/__GH_AW_GITHUB_REPOSITORY__/actions/runs/{run_id}/logs \ diff --git a/.github/workflows/gh-aw-pr-actions-detective.md b/.github/workflows/gh-aw-pr-actions-detective.md index 95c4bb80..a790ff76 100644 --- a/.github/workflows/gh-aw-pr-actions-detective.md +++ b/.github/workflows/gh-aw-pr-actions-detective.md @@ -100,6 +100,7 @@ Assist with failed GitHub Actions checks for pull requests in ${{ github.reposit gh api repos/${{ github.repository }}/actions/runs/{run_id}/jobs \ --jq '.jobs[] | {id: .id, name: .name, conclusion: .conclusion, html_url: .html_url}' ``` + - If none of the jobs have a `failure` conclusion, call `noop` with message "No failed jobs in workflow run; nothing to report" and stop. - Download logs to `/tmp/gh-aw/agent/` and inspect the failing step output: ```bash gh api repos/${{ github.repository }}/actions/runs/{run_id}/logs \ diff --git a/.github/workflows/gh-aw-pr-ci-detective.lock.yml b/.github/workflows/gh-aw-pr-ci-detective.lock.yml index 9775a103..f2712dc9 100644 --- a/.github/workflows/gh-aw-pr-ci-detective.lock.yml +++ b/.github/workflows/gh-aw-pr-ci-detective.lock.yml @@ -41,7 +41,7 @@ # # inlined-imports: true # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"d589e9e92dd79580cfa87ca119b5a0069b7f150690deb67875ebc174d1f63400"} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"8ca49070112f3c71d739dd15e34cdf1512eec4e0634ac25101ca170a10e428f5"} name: "PR Actions Detective" "on": @@ -330,6 +330,7 @@ jobs: gh api repos/__GH_AW_GITHUB_REPOSITORY__/actions/runs/{run_id}/jobs \ --jq '.jobs[] | {id: .id, name: .name, conclusion: .conclusion, html_url: .html_url}' ``` + - If none of the jobs have a `failure` conclusion, call `noop` with message "No failed jobs in workflow run; nothing to report" and stop. - Download logs to `/tmp/gh-aw/agent/` and inspect the failing step output: ```bash gh api repos/__GH_AW_GITHUB_REPOSITORY__/actions/runs/{run_id}/logs \ diff --git a/gh-agent-workflows/branch-actions-detective/README.md b/gh-agent-workflows/branch-actions-detective/README.md index e920a4b3..c30e515f 100644 --- a/gh-agent-workflows/branch-actions-detective/README.md +++ b/gh-agent-workflows/branch-actions-detective/README.md @@ -33,3 +33,4 @@ See [example.yml](example.yml) for the full workflow file. ## Safe Outputs - `create-issue` — file a tracking issue for the CI failure (max 1, auto-closes older issues) +- `noop` — emitted when no failed jobs are found or failure already tracked by an open issue diff --git a/gh-agent-workflows/pr-actions-detective/README.md b/gh-agent-workflows/pr-actions-detective/README.md index 702584b3..85705983 100644 --- a/gh-agent-workflows/pr-actions-detective/README.md +++ b/gh-agent-workflows/pr-actions-detective/README.md @@ -33,3 +33,4 @@ See [example.yml](example.yml) for the full workflow file. ## Safe Outputs - `add-comment` — post a comment explaining the failure (max 3) +- `noop` — emitted when no failed jobs are found or diagnosis unchanged since last report