2.8 KiB
2.8 KiB
name, description
| name | description |
|---|---|
| ci-status | Check the CI pipeline status for the current branch after pushing changes. Reports pass/fail with failure details. Use this after every push to confirm your changes are truly done — CI must be green. TRIGGER when: after git push, after committing changes, when asked to check CI, or when verifying that work is complete. |
CI Status
Monitor the GitHub Actions CI pipeline for the current branch. A feature is not done until CI passes.
Instructions
- Identify the current branch and latest commit:
BRANCH=$(git branch --show-current)
SHA=$(git rev-parse --short HEAD)
echo "Branch: $BRANCH | Commit: $SHA"
- Find the latest CI run for this branch:
gh api "repos/ryaneggz/open-harness/actions/runs?branch=$BRANCH&per_page=1" \
--jq '.workflow_runs[0] | {id: .id, status: .status, conclusion: .conclusion, head_sha: .head_sha[:7], name: .name}'
- If the run is still in progress, poll every 15 seconds (max 5 minutes):
RUN_ID=<id from step 2>
for i in $(seq 1 20); do
STATUS=$(gh api "repos/ryaneggz/open-harness/actions/runs/$RUN_ID" --jq '.status')
if [ "$STATUS" = "completed" ]; then
break
fi
echo "Still running... ($i/20)"
sleep 15
done
- Check the result:
gh api "repos/ryaneggz/open-harness/actions/runs/$RUN_ID" \
--jq '{status: .status, conclusion: .conclusion, url: .html_url}'
- If failed, get the failure details:
# Get the failed job ID
JOB_ID=$(gh api "repos/ryaneggz/open-harness/actions/runs/$RUN_ID/jobs" \
--jq '.jobs[] | select(.conclusion == "failure") | .id')
# Get the failure context (15 lines before the error)
gh api "repos/ryaneggz/open-harness/actions/jobs/$JOB_ID/logs" 2>&1 \
| grep -B 15 "Process completed with exit code" | head -25
- Report the result:
- PASS: Report "CI green" with the run URL
- FAIL: Report the failing step, error message, and suggest a fix. Then fix the issue, commit, push, and run
/ci-statusagain - NO RUN: If no CI run exists for the current commit, the push may not have triggered CI (check branch filter in
.github/workflows/ci.yml)
CI Pipeline Steps
This project's CI (CI: next-postgres-shadcn) runs these steps in order:
- Lint (
npm run lint) - Format check (
npm run format:check) - Type check (
npm run type-check) - Prisma generate (
npx prisma generate) - Prisma migrate (
npx prisma migrate deploy) - Build (
npm run build) - Test (
npm test) - Playwright E2E (
npm run test:e2e)
Local Pre-flight
Before pushing, you can run the same checks locally to catch issues early:
cd workspace/projects/next-app
npm run lint && npm run format:check && npm run type-check && npx prisma generate && npm run build && npm test