workers-sdk
workers-sdk copied to clipboard
🐛 BUG: wrangler2 tries to open a browser to authenticate in CircleCI
What version of Wrangler
are you using?
2.0.23
What operating system are you using?
Linux
Describe the Bug
When publishing in CircleCI without providing a CLOUDFLARE_API_TOKEN
, it tries to open a browser. It timeouts quickly, but I suppose ideally it should not try to open a browser at all.
Demo
version: 2.1
jobs:
browser:
docker:
- image: cimg/node:18.4.0
steps:
- run:
name: "Publish to cloudflare pages (KO)"
command: |
npm i [email protected]
mkdir public
cd public
echo "Hello browser" >> index.html
CLOUDFLARE_ACCOUNT_ID=abcd npx wrangler pages publish . --project-name=open-browser-in-circleci --branch=main
workflows:
release_browser:
jobs:
- browser:
filters:
branches:
only: /^main$/
Will produce:
Yeah, sorry about that. We do not try to open the browser if the terminal is non-TTY (non-interactive). But CircleCI actually has a TTY terminal so we get it wrong. For metrics capture we have gone with the is-ci
approach, which looks for certain environment variables; so we should probably do the same here.
Thank you! :+1: :+1:
@thibault-deriv you should be able to use this fix via wrangler@beta
- let me know if i've missed anything 👀
@rozenmd Verified :smiley: well done!