From 2a3dae65c7b86f803e19e1c5e2a674549c8dae30 Mon Sep 17 00:00:00 2001 From: Simona Badoiu Date: Thu, 5 Feb 2026 17:22:59 +0000 Subject: [PATCH 1/4] Update KV namespace IDs and add account_id to wrangler config - Add account_id to main configuration - Remove default KV namespace binding - Update staging KV namespace ID - Update production KV namespace ID - Remove route configurations from staging and production environments --- wrangler.toml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/wrangler.toml b/wrangler.toml index 1d2a61e..307da19 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -2,9 +2,7 @@ name = "cdnjs-api-worker" main = "src/index.js" compatibility_date = "2022-10-31" compatibility_flags = [ "nodejs_als" ] -kv_namespaces = [ - { binding = "CACHE", id = "845ae1599dcf4d75950b61201a951b73", preview_id = "845ae1599dcf4d75950b61201a951b73" } -] +account_id = "dbf163e9a5fda1c8a0eceeed9ec12c18" [observability.logs] enabled = true @@ -24,9 +22,8 @@ SENTRY_RELEASE = "" SENTRY_ENVIRONMENT = "development" [env.staging] -route = { pattern = "api.cdnjs.dev/*", zone_name = "cdnjs.dev" } kv_namespaces = [ - { binding = "CACHE", id = "34b159dab6f840ce9c17e4d0730ead12" } + { binding = "CACHE", id = "01c2862d489743a1b87c4ce338279392" } ] [env.staging.observability.logs] @@ -47,9 +44,8 @@ SENTRY_RELEASE = "" # Will be injected by build pipeline SENTRY_ENVIRONMENT = "staging" [env.production] -route = { pattern = "api.cdnjs.com/*", zone_name = "cdnjs.com" } kv_namespaces = [ - { binding = "CACHE", id = "c2922fcf1af643658d6769859b913134" } + { binding = "CACHE", id = "6a1fda0afa5a4b73af5302f40b34752c" } ] [env.production.observability.logs] From cce95d0e4fa4c43167b8c57984d9cfef94597991 Mon Sep 17 00:00:00 2001 From: Simona Badoiu Date: Thu, 5 Feb 2026 17:23:17 +0000 Subject: [PATCH 2/4] Update GitHub Actions secrets to use unified Cloudflare credentials - Replace CLOUDFLARE_API_TOKEN_PRODUCTION with CLOUDFLARE_CDNJS_ACCOUNT_ID in production workflow - Replace CLOUDFLARE_ACCOUNT_ID_PRODUCTION with CLOUDFLARE_CDNJS_ACCOUNT_ID in production workflow - Replace CLOUDFLARE_API_TOKEN_STAGING with CLOUDFLARE_CDNJS_ACCOUNT_ID in staging workflow - Replace CLOUDFLARE_ACCOUNT_ID_STAGING with CLOUDFLARE_CDNJS_ACCOUNT_ID in staging workflow --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e187f8a..1d3768f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,8 +35,8 @@ jobs: - name: Deploy to ${{ github.ref_name }} run: npx wrangler deploy --env ${{ github.ref_name }} --outdir dist-worker --minify --var SENTRY_DSN:${{ secrets.SENTRY_DSN }} --var SENTRY_RELEASE:${{ github.sha }} env: - CLOUDFLARE_API_TOKEN: ${{ github.ref_name == 'production' && secrets.CLOUDFLARE_API_TOKEN_PRODUCTION || secrets.CLOUDFLARE_API_TOKEN_STAGING }} - CLOUDFLARE_ACCOUNT_ID: ${{ github.ref_name == 'production' && secrets.CLOUDFLARE_ACCOUNT_ID_PRODUCTION || secrets.CLOUDFLARE_ACCOUNT_ID_STAGING }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_CDNJS_ACCOUNT_ID }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_CDNJS_ACCOUNT_ID }} - name: Create Sentry Release uses: getsentry/action-release@dab6548b3c03c4717878099e43782cf5be654289 # v3.5.0 From 062a0e9b754dbc3a03366ed129d71608d5f9ef94 Mon Sep 17 00:00:00 2001 From: Simona Badoiu Date: Thu, 5 Feb 2026 17:26:00 +0000 Subject: [PATCH 3/4] Fix GitHub Actions to use correct API token secret for deployments - Replace CLOUDFLARE_CDNJS_ACCOUNT_ID with CLOUDFLARE_CDNJS_API_TOKEN for CLOUDFLARE_API_TOKEN in production workflow - Replace CLOUDFLARE_CDNJS_ACCOUNT_ID with CLOUDFLARE_CDNJS_API_TOKEN for CLOUDFLARE_API_TOKEN in staging workflow --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1d3768f..b9183d8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,7 +35,7 @@ jobs: - name: Deploy to ${{ github.ref_name }} run: npx wrangler deploy --env ${{ github.ref_name }} --outdir dist-worker --minify --var SENTRY_DSN:${{ secrets.SENTRY_DSN }} --var SENTRY_RELEASE:${{ github.sha }} env: - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_CDNJS_ACCOUNT_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_CDNJS_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_CDNJS_ACCOUNT_ID }} - name: Create Sentry Release From 2735238028e01837642d6961fa781e01d2307d83 Mon Sep 17 00:00:00 2001 From: MattIPv4 Date: Mon, 9 Feb 2026 00:13:15 +0000 Subject: [PATCH 4/4] Ensure KV binding is defined for local dev + tests --- wrangler.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wrangler.toml b/wrangler.toml index 307da19..f960042 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -3,6 +3,9 @@ main = "src/index.js" compatibility_date = "2022-10-31" compatibility_flags = [ "nodejs_als" ] account_id = "dbf163e9a5fda1c8a0eceeed9ec12c18" +kv_namespaces = [ + { binding = "CACHE" } +] [observability.logs] enabled = true