Skip to content

Commit 9ecd33c

Browse files
authored
Merge pull request #9174 from BitGo/HSM-429-iyarc-prune-diagnose-is-error
chore(root): surface iyarc-prune claude error and fail on is_error
2 parents 3f57d3c + 574c1ec commit 9ecd33c

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/iyarc-prune.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@ jobs:
6969
} >> "$GITHUB_OUTPUT"
7070
7171
- name: Run Claude Code (Bedrock)
72+
id: claude
7273
uses: anthropics/claude-code-action@v1
7374
with:
7475
prompt: ${{ steps.agent.outputs.content }}
7576
use_commit_signing: 'true'
7677
branch_prefix: 'iyarc-prune/'
78+
# TEMPORARY (HSM-429 diagnosis): revert to false once fixed.
79+
show_full_output: 'true'
7780
claude_args: --allowed-tools 'Edit,MultiEdit,Write,Read,Glob,Grep,LS,Bash,mcp__github_file_ops__commit_files,mcp__github_file_ops__delete_files'
7881
use_bedrock: 'true'
7982
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -84,3 +87,22 @@ jobs:
8487
AWS_SECRET_ACCESS_KEY: ${{ steps.inference-role.outputs.aws-secret-access-key }}
8588
AWS_SESSION_TOKEN: ${{ steps.inference-role.outputs.aws-session-token }}
8689
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
91+
- name: Surface Claude error and fail on is_error
92+
if: always()
93+
env:
94+
EXECUTION_FILE: ${{ steps.claude.outputs.execution_file }}
95+
run: |
96+
set -euo pipefail
97+
if [ -z "${EXECUTION_FILE:-}" ] || [ ! -f "$EXECUTION_FILE" ]; then
98+
echo "::error::no Claude execution file produced"; exit 1
99+
fi
100+
EVENTS="$(jq -c 'if type=="array" then . else [.] end' "$EXECUTION_FILE")"
101+
echo "=== result event (metadata only) ==="
102+
echo "$EVENTS" | jq -c 'map(select(.type=="result"))[-1] // empty'
103+
echo "=== assistant text turns (no tool output) ==="
104+
echo "$EVENTS" | jq -r '.[] | select(.type=="assistant") | .message.content[]? | select(.type=="text") | .text'
105+
RES="$(echo "$EVENTS" | jq -c 'map(select(.type=="result"))[-1] // empty')"
106+
if [ "$(echo "$RES" | jq -r '.is_error // false')" = "true" ]; then
107+
echo "::error::Claude returned is_error=true"; exit 1
108+
fi

0 commit comments

Comments
 (0)