Files
prose-contracts/.gitea/workflows/pr-pipeline.yaml
T
root 3dd2698ef8
PR Pipeline — Authorize → Validate → Review → Merge / auth (push) Failing after 3s
PR Pipeline — Authorize → Validate → Review → Merge / validate (push) Has been skipped
PR Pipeline — Authorize → Validate → Review → Merge / lint (push) Has been skipped
PR Pipeline — Authorize → Validate → Review → Merge / ai-review (push) Has been skipped
PR Pipeline — Authorize → Validate → Review → Merge / gate (push) Has been skipped
fix: add native git checkout + fix validator increment/exit bugs
- Replaced actions/checkout@v4 with native git clone (no Node.js needed)
- Fixed FAILED counter: increment instead of resetting to 1
- Fixed exit condition: -gt 0 instead of -eq 1 (caught >1 violation)
- Test-violations.prose.md still present — pipeline should now catch it
2026-07-04 23:00:03 +00:00

107 lines
3.8 KiB
YAML

name: PR Pipeline — Authorize → Validate → Review → Merge
on:
push:
branches: [master]
paths:
- '**.prose.md'
- 'scripts/**.sh'
- '**.yaml'
- '**.yml'
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.prose.md'
- 'scripts/**.sh'
- '**.yaml'
- '**.yml'
jobs:
auth:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
run: |
git clone --depth=50 "https://${{ gitea.server_url }}/${{ gitea.repository }}.git" .
git fetch origin "${{ gitea.ref }}" --depth=50
git checkout "${{ gitea.sha }}"
- name: Authorization check
run: bash scripts/prose-auth-check.sh
validate:
runs-on: ubuntu-latest
needs: auth
steps:
- name: Checkout repository
run: |
git clone --depth=50 "https://${{ gitea.server_url }}/${{ gitea.repository }}.git" .
git fetch origin "${{ gitea.ref }}" --depth=50
git checkout "${{ gitea.sha }}"
- name: YAML frontmatter validation
run: |
echo "=== Prose Contract Frontmatter Validation ==="
FAILED=0
for f in $(find . -name "*.prose.md" -not -path "./.git/*" -not -path "./runs/*"); do
FM=$(sed -n '/^---$/,/^---$/p' "$f" | sed '1d;$d')
[ -z "$FM" ] && { echo " ❌ $f: No YAML frontmatter"; FAILED=$((FAILED+1)); continue; }
KIND=$(echo "$FM" | grep '^kind:' | awk '{print $2}')
case "$KIND" in
function|responsibility|gateway|pattern|test|template|architecture|enforcement) echo " ✅ $f: kind=$KIND" ;;
*) echo " ❌ $f: Invalid kind='$KIND'"; FAILED=$((FAILED+1)) ;;
esac
echo "$FM" | grep -q '^name:' || { echo " ❌ $f: Missing name"; FAILED=$((FAILED+1)); }
echo "$FM" | grep -q '^description:' || { echo " ❌ $f: Missing description"; FAILED=$((FAILED+1)); }
done
[ $FAILED -gt 0 ] && { echo "❌ FRONTMATTER FAILED ($FAILED error(s))"; exit 1; }
echo "✅ Frontmatter validation passed"
lint:
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout repository
run: |
git clone --depth=50 "https://${{ gitea.server_url }}/${{ gitea.repository }}.git" .
git fetch origin "${{ gitea.ref }}" --depth=50
git checkout "${{ gitea.sha }}"
- name: Structure + regression + consistency lint
run: bash scripts/prose-lint.sh
ai-review:
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout repository
run: |
git clone --depth=50 "https://${{ gitea.server_url }}/${{ gitea.repository }}.git" .
git fetch origin "${{ gitea.ref }}" --depth=50
git checkout "${{ gitea.sha }}"
- name: AI-powered contract review
env:
LITELLM_URL: ${{ secrets.LITELLM_URL }}
LITELLM_KEY: ${{ secrets.LITELLM_KEY }}
run: bash scripts/prose-ai-review.sh
gate:
runs-on: ubuntu-latest
needs: [auth, validate, lint, ai-review]
if: success()
steps:
- name: Merge gate
run: |
echo "╔══════════════════════════════════════╗"
echo "║ ALL CHECKS PASSED — SAFE TO MERGE ║"
echo "╚══════════════════════════════════════╝"
echo ""
echo " ✅ auth — authorized agent"
echo " ✅ validate — frontmatter valid"
echo " ✅ lint — structure + no regressions"
echo " ✅ ai-review — no contradictions with ground truth"
echo ""
echo "Merge this PR to deploy to main."