diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 780a41b..852dd68 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,7 +2,7 @@ Describe what this PR changes. ## Linked Issue -Closes # +N/A (replace with `Closes #` when this PR resolves a tracked issue) ## Type of Change - [ ] Bug fix diff --git a/.github/workflows/require-issue-link.yml b/.github/workflows/require-issue-link.yml index bc599bd..9eb32bd 100644 --- a/.github/workflows/require-issue-link.yml +++ b/.github/workflows/require-issue-link.yml @@ -9,13 +9,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Check PR body for issue reference + env: + PR_BODY: ${{ github.event.pull_request.body || '' }} shell: bash run: | - BODY="${{ github.event.pull_request.body }}" - if echo "$BODY" | grep -Eiq '(closes|fixes|resolves)\s+#[0-9]+'; then + if printf '%s\n' "$PR_BODY" | grep -Eiq '(closes|fixes|resolves)\s+#[0-9]+'; then echo "Issue reference found." exit 0 fi - echo "PR description must include: Closes # (or Fixes/Resolves)." + if printf '%s\n' "$PR_BODY" | grep -Eiq '(^|[^[:alpha:]])(n/?a|none|no issue)([^[:alpha:]]|$)'; then + echo "No linked issue declared." + exit 0 + fi + + if printf '%s\n' "$PR_BODY" | grep -Eq '^Closes #\s*$'; then + echo "Legacy linked-issue placeholder found." + exit 0 + fi + + echo "PR description must include either a linked issue reference (for example, Closes #123) or an explicit no-issue marker such as N/A." exit 1 diff --git a/Readme.md b/Readme.md index 017a0eb..3f8d7ef 100644 --- a/Readme.md +++ b/Readme.md @@ -90,17 +90,17 @@ cd Ecommerce-Frontend # 3. Install dependencies npm install -# 4. Create a .env file with the required environment variables +# 4. Create a .env.development file with the required environment variables # 5. Start the development server npm run dev ``` ### Environment Variables -Create a `.env` file in the project root: +For local development, create a `.env.development` file in the project root (or copy the existing template): ```env -VITE_BACK_END_URL=http://localhost:5000 +VITE_API_BASE_URL=http://localhost:5000 VITE_BACK_END_API_PREFIX=/api VITE_API_AUTH_BASE_URL=http://localhost:5000/api/auth VITE_API_PUBLIC_BASE_URL=http://localhost:5000/api/public @@ -109,6 +109,10 @@ VITE_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key VITE_SKIP_BACKEND_IMAGES=false ``` +`vite.config.js` requires `VITE_API_BASE_URL` for both development and production modes. Define it in `.env.development` and `.env.production` as appropriate; `VITE_BACK_END_URL` alone is not sufficient. For machine-specific or local-only values, use `.env.development.local`, which is ignored by Git and must not be committed. + +Every variable prefixed with `VITE_` is exposed to client-side code and must be treated as public. Never put server-only secrets, private API keys, or database credentials in these files; keep those values in the backend environment instead. The Stripe publishable key is safe to expose by design, but secret Stripe keys are not. + ## Docker To build and run the application in a container: