From d290f3ea62816f351fce111a87d904f3656100be Mon Sep 17 00:00:00 2001 From: Sasa Junuzovic Date: Sun, 15 Mar 2026 19:39:47 -0700 Subject: [PATCH] fix: gate agent workflows on aw label via if: condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Agent workflows (review-responder, quality-gate) were firing on ALL pull_request_review events regardless of PR author or labels. The aw label check was only in the agent prompt (soft guard) — the agent still activated and burned tokens before noop'ing. Added if: contains(github.event.pull_request.labels.*.name, 'aw') to both workflow frontmatters. This compiles to a job-level if: on the activation job, so the workflow skips entirely without burning any compute or inference tokens. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/quality-gate.lock.yml | 3 ++- .github/workflows/quality-gate.md | 1 + .github/workflows/review-responder.lock.yml | 3 ++- .github/workflows/review-responder.md | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/quality-gate.lock.yml b/.github/workflows/quality-gate.lock.yml index 4aa094c..c20f2a9 100644 --- a/.github/workflows/quality-gate.lock.yml +++ b/.github/workflows/quality-gate.lock.yml @@ -22,7 +22,7 @@ # For more information: https://github.github.com/gh-aw/introduction/overview/ # # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"51b7c0f46336464fcff657fb3d3e63ff0c9f9b4a578b0d86b63f251df8bd6434","compiler_version":"v0.58.1","strict":true} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"15df3ac9ea802b32be49f9486f73a665c2e27c493cb502a1c8f1e1aac1d9b8a9","compiler_version":"v0.58.1","strict":true} name: "Quality Gate" "on": @@ -44,6 +44,7 @@ run-name: "Quality Gate" jobs: activation: + if: contains(github.event.pull_request.labels.*.name, 'aw') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/quality-gate.md b/.github/workflows/quality-gate.md index 6ce7c2a..69517e9 100644 --- a/.github/workflows/quality-gate.md +++ b/.github/workflows/quality-gate.md @@ -1,4 +1,5 @@ --- +if: "contains(github.event.pull_request.labels.*.name, 'aw')" on: pull_request_review: types: [submitted] diff --git a/.github/workflows/review-responder.lock.yml b/.github/workflows/review-responder.lock.yml index e08e607..5e45691 100644 --- a/.github/workflows/review-responder.lock.yml +++ b/.github/workflows/review-responder.lock.yml @@ -22,7 +22,7 @@ # For more information: https://github.github.com/gh-aw/introduction/overview/ # # -# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"e1defa99f6997703c92f43de1a3dcd3fcc7661ead5eb63b2ac8f1023f3db57be","compiler_version":"v0.58.1","strict":true} +# gh-aw-metadata: {"schema_version":"v2","frontmatter_hash":"35ba5d1e915453dfb8bb36f204c8e88294a212d8699ccd2b25513ce1bcece680","compiler_version":"v0.58.1","strict":true} name: "Review Responder" "on": @@ -44,6 +44,7 @@ run-name: "Review Responder" jobs: activation: + if: contains(github.event.pull_request.labels.*.name, 'aw') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/review-responder.md b/.github/workflows/review-responder.md index 0e56cea..0cb7647 100644 --- a/.github/workflows/review-responder.md +++ b/.github/workflows/review-responder.md @@ -1,4 +1,5 @@ --- +if: "contains(github.event.pull_request.labels.*.name, 'aw')" on: pull_request_review: types: [submitted]