From ab41ce36521d04a828cfb3a11494e217401e943d Mon Sep 17 00:00:00 2001 From: Hweinstock Date: Fri, 12 Jun 2026 22:20:38 +0000 Subject: [PATCH] fix(ci): avoid running pr reviewer on closed prs --- .github/workflows/pr-ai-review.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-ai-review.yml b/.github/workflows/pr-ai-review.yml index 26878d7a1..c1e908a3e 100644 --- a/.github/workflows/pr-ai-review.yml +++ b/.github/workflows/pr-ai-review.yml @@ -18,7 +18,10 @@ permissions: jobs: authorize: runs-on: ubuntu-latest - if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request_target' + # explicitly require the PR to be open to avoid old events triggering a review on closed PRs: https://github.com/aws/agentcore-cli/issues/1463 + if: + github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request_target' && + github.event.pull_request.state == 'open') outputs: authorized: ${{ steps.auth.outputs.authorized }} steps: