Skip to content

Refactor/arch insights ap fix #39

Refactor/arch insights ap fix

Refactor/arch insights ap fix #39

Workflow file for this run

name: CodeAutopsy Architecture Scan
on:
pull_request:
types: [opened, synchronize]
jobs:
analyze-architecture:
runs-on: ubuntu-latest
permissions:
pull-requests: write # Required for posting comments to the PR
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Call CodeAutopsy Engine
id: autopsy
run: |
# 1. Hit your live Vercel API
RESPONSE=$(curl -s -X POST https://codeautopsy-lyart.vercel.app/api/github-action \
-H "Content-Type: application/json" \
-d "{\"owner\": \"${{ github.repository_owner }}\", \"repo\": \"${{ github.event.repository.name }}\", \"commitSha\": \"${{ github.event.pull_request.head.sha }}\"}")
# 2. Extract the markdown snippet using jq
SNIPPET=$(echo "$RESPONSE" | jq -r '.markdownSnippet')
# 3. Save to GitHub Environment for the next step
{
echo 'SNIPPET<<EOF'
echo "$SNIPPET"
echo 'EOF'
} >> $GITHUB_ENV
- name: Inject Interactive Map into PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# 4. Use GitHub CLI to post the comment
gh pr comment ${{ github.event.pull_request.number }} --body "$SNIPPET"