From ce375dbb31842ddcd87d86a65c56e3c58f5ee075 Mon Sep 17 00:00:00 2001 From: Codewithaiyan Date: Wed, 27 May 2026 23:51:52 +0530 Subject: [PATCH 1/2] fix: add Vercel URL to CORS allowed origins --- backend/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/main.py b/backend/main.py index d6d31b4..adb4e99 100644 --- a/backend/main.py +++ b/backend/main.py @@ -11,7 +11,11 @@ app.add_middleware( CORSMiddleware, - allow_origins=["http://localhost:5173"], + allow_origins=[ + "http://localhost:5173", + "https://vibe-guard-phi.vercel.app", + "https://*.vercel.app", + ], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], From c9fe3ce3cb547d9b62c5f401d23c4d5d58c6c6e2 Mon Sep 17 00:00:00 2001 From: Codewithaiyan Date: Thu, 28 May 2026 00:00:16 +0530 Subject: [PATCH 2/2] fix: use live Render backend in GitHub Actions --- .github/workflows/vibeguard.yml | 58 ++------------------------------- 1 file changed, 2 insertions(+), 56 deletions(-) diff --git a/.github/workflows/vibeguard.yml b/.github/workflows/vibeguard.yml index f4631c4..b02bdfd 100644 --- a/.github/workflows/vibeguard.yml +++ b/.github/workflows/vibeguard.yml @@ -21,6 +21,7 @@ jobs: runs-on: ubuntu-latest env: COMMENT_MARKER: "" + BACKEND_URL: https://vibeguard-backend.onrender.com steps: - name: Checkout code @@ -28,54 +29,6 @@ jobs: with: fetch-depth: 0 - - name: Setup Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install backend dependencies - run: | - set -euo pipefail - cd backend - python -m pip install --upgrade pip - pip install -r requirements.txt - - - name: Create backend/.env file - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - run: | - set -euo pipefail - - if [ -z "${OPENAI_API_KEY:-}" ]; then - echo "OPENAI_API_KEY secret is required for the VibeGuard security scan." >&2 - exit 1 - fi - - cat > backend/.env < ../backend.log 2>&1 & - echo $! > ../backend.pid - - - name: Wait for backend to be ready - run: | - set -euo pipefail - sleep 8 - curl --fail --silent --show-error --retry 5 --retry-delay 2 --retry-connrefused http://localhost:8000/health || { - echo "VibeGuard backend failed health checks." >&2 - if [ -f backend.log ]; then - cat backend.log >&2 - fi - exit 1 - } - - name: Scan changed files id: scan run: | @@ -186,7 +139,7 @@ jobs: --request POST \ --header 'Content-Type: application/json' \ --data "$payload" \ - http://localhost:8000/scan 2>"$curl_error_file")" + "$BACKEND_URL/scan" 2>"$curl_error_file")" curl_status=$? set -e @@ -306,10 +259,3 @@ jobs: exit 1 fi - - name: Stop backend - if: always() - run: | - set -euo pipefail - if [ -f backend.pid ]; then - kill "$(cat backend.pid)" || true - fi