Skip to content

[BUG] Test first bug report #2

[BUG] Test first bug report

[BUG] Test first bug report #2

name: Issue Responder
on:
issues:
types: [opened]
permissions:
id-token: write
contents: read
jobs:
respond-to-issue:
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.STRANDS_AGENTCORE_ACTIONS_ROLE }}
aws-region: us-west-2
- name: Install AgentCore CLI
run: |
pip install bedrock-agentcore-starter-toolkit
- name: Invoke AgentCore with issue details
env:
GH_ISSUE_AGENTCORE_RUNTIME_ARN: ${{ secrets.GH_ISSUE_AGENTCORE_RUNTIME_ARN }}
run: |
# Construct the payload JSON
PAYLOAD=$(cat <<EOF
{
"source": "github",
"action": "issue_opened",
"issue": {
"number": ${{ github.event.issue.number }},
"title": $(echo '${{ github.event.issue.title }}' | jq -Rs .),
"body": $(echo '${{ github.event.issue.body }}' | jq -Rs .),
"url": "${{ github.event.issue.html_url }}",
"author": "${{ github.event.issue.user.login }}",
"repo": "${{ github.repository }}"
}
}
EOF
)
echo "Invoking AgentCore with payload:"
echo "$PAYLOAD" | jq .
# Invoke the AgentCore runtime
agentcore invoke \
--runtime-arn "$GH_ISSUE_AGENTCORE_RUNTIME_ARN" \
--payload "$PAYLOAD"