feat: add GitHub Action for automated PR review via AgentCore Harness#934
Merged
jesseturner21 merged 11 commits intoaws:mainfrom Apr 24, 2026
Merged
Conversation
Adds a workflow that reviews PRs using Bedrock AgentCore Harness. The harness runs an AI agent in an isolated microVM with gh, git, and pre-cloned repos that fetches PR diffs and posts review comments. Workflow: - Triggers on PR open/reopen for agentcore-cli-devs team members - Supports manual workflow_dispatch for any PR URL - Adds/removes ai-reviewing label during review - Authenticates via GitHub OIDC to assume AWS role Files: - .github/workflows/pr-ai-review.yml — main workflow - .github/scripts/python/harness_review.py — harness invocation script - .github/scripts/python/harness_config.py — config from env vars - .github/scripts/models/ — local boto3 service model (InvokeHarness not yet in standard boto3) Required secrets: - HARNESS_AWS_ROLE_ARN — IAM role ARN for OIDC - HARNESS_ACCOUNT_ID — AWS account ID - HARNESS_ID — Harness ID
Eliminates the 220KB bundled service model by using direct HTTP requests with SigV4 authentication to invoke the harness endpoint. No extra dependencies needed — urllib3, SigV4Auth, and EventStreamBuffer are all part of botocore/boto3. Rejected: invoke_agent_runtime API | server rejects harness ARNs with ResourceNotFoundException Confidence: high Scope-risk: moderate
Remove separate harness_config.py — env vars are read directly in harness_review.py. One less file to maintain, config is still driven entirely by environment variables set in the GitHub workflow.
- Replace HARNESS_ACCOUNT_ID + HARNESS_ID with single HARNESS_ARN env var - Extract prompts into separate .md files in .github/scripts/prompts/ - Extract stream parsing into print_stream() function - Add close_group() helper to deduplicate ::group:: bookkeeping
Extract parse_events() generator to handle binary stream decoding, keeping print_stream() focused on formatting and log groups.
Eliminates HARNESS_REGION env var — the region is extracted from the ARN directly, so there's no risk of a mismatch causing confusing SigV4 auth errors.
Split into authorize + ai-review jobs. The ai-review job only runs if the PR author is authorized (team member or write access) or if triggered via workflow_dispatch. Removes repeated if conditions from every step.
Hweinstock
reviewed
Apr 23, 2026
Contributor
Hweinstock
left a comment
There was a problem hiding this comment.
Very excited for this! I like how you extracted out the prompts because I think we can iterate on this over time.
Contributor
|
it looks like formatting doesn't like how you wrote the markdown. Maybe we can skip link checks on these? |
Prompt markdown files use intentional formatting that prettier would reflow, breaking the prompt structure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gh,git, and pre-cloned repos that fetches PR diffs, reads code context, and posts review comments directly on GitHubagentcore-cli-devsteam members, with manualworkflow_dispatchfor any PRai-reviewinglabel during reviewFiles added
.github/workflows/pr-ai-review.yml.github/scripts/python/harness_review.py.github/scripts/prompts/system.md.github/scripts/prompts/review.mdRequired secrets
HARNESS_AWS_ROLE_ARN— IAM role ARN for GitHub OIDCHARNESS_ARN— Full ARN of the Bedrock AgentCore harnessTest plan
jesseturner21/agentcore-cliforkai-reviewinglabel add/removeworkflow_dispatchwith custom PR URL