cloudflare / cloudflare/wrangler-action

uploading environment secrets doesn't work with pages deploy

Open
#304 5 comments 5 reactions 0 assignees View on GitHub
bug triaged
Dominant language
TypeScript
Stars
1.9k
Forks
214
PR merge metrics
No merged PRs in 30d

Description

https://github.com/cloudflare/wrangler-action/blob/cd8a317efbc7fab418e9bd7092c8643d88c03321/src/index.ts#L251

When the repository is pages directory, it needs to run

```terminal
wrangler pages secret bulk
```

Otherwise it will run into the following error:
```
🔑 Uploading secrets...
/opt/hostedtoolcache/node/18.20.4/x64/bin/npx wrangler secret:bulk

⛅️ wrangler 3.81.0
-------------------


✘ [ERROR] It looks like you've run a Workers-specific command in a Pages project.

For Pages, please run `wrangler pages secret bulk` instead.


🪵 Logs were written to "/home/runner/.config/.wrangler/logs/wrangler-2024-10-20_12-06-13_693.log"
Error: The process '/opt/hostedtoolcache/node/18.20.4/x64/bin/npx' failed with exit code 1
Error: Failed to upload secrets.
Error: 🚨 Action failed
```

Contributor guide

Open the contributing guide

Research direction

The relevant entry point is src/index.ts around line 251. Read how the action selects the Wrangler secret command for Pages versus Workers, then verify that Pages deployments invoke `wrangler pages secret bulk` and that the reported failure no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, cloud
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.