Explorar el Código

ci(e2e): source key from DEEPSEEK_API_KEY_EXTERNAL secret

The repo secret is named DEEPSEEK_API_KEY_EXTERNAL; map it to the
DEEPSEEK_API_KEY env var the e2e suites read (process.env.DEEPSEEK_API_KEY).
Tianyi Cui hace 2 meses
padre
commit
759ef04692
Se han modificado 1 ficheros con 8 adiciones y 5 borrados
  1. 8 5
      .github/workflows/e2e.yml

+ 8 - 5
.github/workflows/e2e.yml

@@ -1,7 +1,8 @@
 name: E2E (real DeepSeek API)
 name: E2E (real DeepSeek API)
 
 
 # Real-API end-to-end suite (`pnpm run test:e2e`). Unlike ci.yml this job
 # Real-API end-to-end suite (`pnpm run test:e2e`). Unlike ci.yml this job
-# consumes the DEEPSEEK_API_KEY secret and hits the external API at
+# consumes the DEEPSEEK_API_KEY_EXTERNAL secret (mapped to the env var
+# DEEPSEEK_API_KEY the tests read) and hits the external API at
 # https://api.deepseek.com (DEEPSEEK_BASE_URL is pinned to it explicitly so a
 # https://api.deepseek.com (DEEPSEEK_BASE_URL is pinned to it explicitly so a
 # stray repo-root .env can't redirect the run).
 # stray repo-root .env can't redirect the run).
 #
 #
@@ -67,12 +68,14 @@ jobs:
       # excludes keyless PRs), so the secret MUST be present — fail loudly if not.
       # excludes keyless PRs), so the secret MUST be present — fail loudly if not.
       - name: Preflight (require DEEPSEEK_API_KEY)
       - name: Preflight (require DEEPSEEK_API_KEY)
         env:
         env:
-          DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
+          # Repo secret DEEPSEEK_API_KEY_EXTERNAL holds the external-API key;
+          # the tests read process.env.DEEPSEEK_API_KEY, so map it across here.
+          DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
         run: |
         run: |
           set -euo pipefail
           set -euo pipefail
           if [ -z "${DEEPSEEK_API_KEY:-}" ]; then
           if [ -z "${DEEPSEEK_API_KEY:-}" ]; then
-            echo "::error::DEEPSEEK_API_KEY is not set. The e2e suite would self-skip and"
-            echo "::error::report a false green. Configure the repo secret DEEPSEEK_API_KEY."
+            echo "::error::DEEPSEEK_API_KEY is empty. The e2e suite would self-skip and"
+            echo "::error::report a false green. Configure the repo secret DEEPSEEK_API_KEY_EXTERNAL."
             exit 1
             exit 1
           fi
           fi
           echo "DEEPSEEK_API_KEY present."
           echo "DEEPSEEK_API_KEY present."
@@ -84,6 +87,6 @@ jobs:
       # this step (and preflight) only — never exposed to checkout/setup/install.
       # this step (and preflight) only — never exposed to checkout/setup/install.
       - name: E2E tests (real DeepSeek API)
       - name: E2E tests (real DeepSeek API)
         env:
         env:
-          DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
+          DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY_EXTERNAL }}
           DEEPSEEK_BASE_URL: https://api.deepseek.com
           DEEPSEEK_BASE_URL: https://api.deepseek.com
         run: pnpm run test:e2e
         run: pnpm run test:e2e