cloudflare / wrangler-action

πŸ§™β€β™€οΈ easily deploy cloudflare workers applications using wrangler and github actions
Apache License 2.0
1.26k stars 159 forks source link

[ERROR] Must specify a project name. #254

Closed FrancescoSaverioZuppichini closed 6 months ago

FrancescoSaverioZuppichini commented 7 months ago

Dear all,

Running the action on my CI/CD results in the following error

Installing Wrangler
  /home/runner/.bun/bin/bun i wrangler@3.13.2
  bun add v1.1.4 (fbe2fe0c)
   Saved lockfile
   installed wrangler@3.[13](https://github.com/FrancescoSaverioZuppichini/nextjs-cloudfare/actions/runs/8822788384/job/24221760187#step:8:14).2 with binaries:
    - wrangler
    - wrangler2
  [[14](https://github.com/FrancescoSaverioZuppichini/nextjs-cloudfare/actions/runs/8822788384/job/24221760187#step:8:15).00ms] done
  βœ… Wrangler installed
πŸš€ Running Wrangler Commands
  /home/runner/.bun/bin/bunx wrangler pages deploy .vercel/output/static --env preview
  ✘ [ERROR] Must specify a project name.

The yml file is:

        - name: Deploy
        uses: cloudflare/wrangler-action@v3.4.1
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          command: pages deploy .vercel/output/static --env preview
          packageManager: bun

While, when I run the command locally

 wrangler pages deploy .vercel/output/static --env preview

Everything is fine

✨ Compiled Worker successfully
✨ Uploading Worker bundle
✨ Uploading _routes.json
✨ Deployment complete! Take a peek over at bla bla bla

Thanks a lot ❀️

Cheers,

Fra

Maximo-Guk commented 6 months ago

Hi there,

When deploying your pages site using wrangler action, you can specify your project name in the command line arguments like so --project-name=example. It's also possible to specify your project-name in the wrangler.toml, however from your build logs it looks as though there may have been some parsing errors when parsing your configuration file.

image

I'd also recommend updating to the latest version of wrangler action. Please see https://github.com/cloudflare/wrangler-action?tab=readme-ov-file#deploy-your-pages-site-production--preview for further reference on pages deployments using wrangler-action!