Skip to content

Commit 1b421cb

Browse files
rfayclaude
andcommitted
Fix Cloudflare workflow to use vars instead of secrets for account/project
- Change CF_ACCOUNT_ID and CF_PAGES_PROJECT from secrets to vars references - Update documentation to clarify secrets vs variables configuration - This resolves deployment failures due to missing secret references 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 6c78b22 commit 1b421cb

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.github/FORK_PREVIEW_SETUP.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ Create an API token with Pages permissions:
3535
5. Set account and zone resources as needed
3636
6. Save the token
3737

38-
### 3. Repository Secrets
38+
### 3. Repository Secrets and Variables
3939

40-
Add these secrets in GitHub repository settings → Secrets and variables → Actions:
40+
Add these in GitHub repository settings → Secrets and variables → Actions:
4141

42+
**Repository Secrets:**
4243
- `CF_API_TOKEN`: The API token from step 2
44+
45+
**Repository Variables:**
4346
- `CF_ACCOUNT_ID`: Your Cloudflare Account ID (found in dashboard sidebar)
4447
- `CF_PAGES_PROJECT`: The project name from step 1
4548

.github/workflows/cloudflare-preview-forks.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ jobs:
284284
- name: Check required secrets
285285
env:
286286
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
287-
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
288-
CF_PAGES_PROJECT: ${{ secrets.CF_PAGES_PROJECT }}
287+
CF_ACCOUNT_ID: ${{ vars.CF_ACCOUNT_ID }}
288+
CF_PAGES_PROJECT: ${{ vars.CF_PAGES_PROJECT }}
289289
run: |
290290
missing=0
291291
for v in CF_API_TOKEN CF_ACCOUNT_ID CF_PAGES_PROJECT; do
@@ -309,11 +309,11 @@ jobs:
309309
id: pages
310310
uses: cloudflare/pages-action@v1
311311
with:
312-
# Required repo secrets (GitHub > Settings > Secrets and variables > Actions)
312+
# Required repo secrets and variables (GitHub > Settings > Secrets and variables > Actions)
313313
# CF_PAGES_PROJECT should be a Pages project created as "Direct Upload" (no Git integration).
314314
apiToken: ${{ secrets.CF_API_TOKEN }}
315-
accountId: ${{ secrets.CF_ACCOUNT_ID }}
316-
projectName: ${{ secrets.CF_PAGES_PROJECT }}
315+
accountId: ${{ vars.CF_ACCOUNT_ID }}
316+
projectName: ${{ vars.CF_PAGES_PROJECT }}
317317
directory: site-dist
318318
# Stable per-PR preview
319319
branch: pr-${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)