fix: fail CI job when validation finds issues

Add verdict step that writes PASS/FAIL to a file, with a follow-up
workflow step that exits 1 on FAIL. Previously validation reported
issues in comments but the job always succeeded.
This commit is contained in:
Kevin Turcios 2026-03-27 06:09:21 -05:00
parent a9fa0687d5
commit 037b1940eb

View file

@ -142,8 +142,30 @@ jobs:
---
*Validated by plugin-dev + codeflash-agent checks*
</step>
<step name="verdict">
If ANY step above found issues that need fixing, write FAIL:
Run: python3 -c "open('/tmp/validation-verdict','w').write('FAIL')"
If all steps passed with no issues, write PASS:
Run: python3 -c "open('/tmp/validation-verdict','w').write('PASS')"
</step>
claude_args: '--model us.anthropic.claude-sonnet-4-6 --allowedTools "Agent,Read,Glob,Grep,Bash(gh pr diff*),Bash(gh pr view*),Bash(gh pr comment*),Bash(gh api*),Bash(git diff*),Bash(git log*),Bash(git status*),Bash(cat *),Bash(python3 *),Bash(jq *)"'
- name: Check validation verdict
if: always()
run: |
if [ ! -f /tmp/validation-verdict ]; then
echo "::warning::No validation verdict file — Claude may not have reached the verdict step"
exit 0
fi
verdict=$(cat /tmp/validation-verdict)
echo "Verdict: $verdict"
if [ "$verdict" = "FAIL" ]; then
echo "::error::Plugin validation found issues that need fixing"
exit 1
fi
claude-mention:
concurrency:
group: claude-mention-${{ github.event.issue.number || github.event.pull_request.number || github.run_id }}