-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C3: Detect production branch when creating pages project #3644
Conversation
🦋 Changeset detectedLatest commit: cb9f8ac The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5612709932/npm-package-wrangler-3644 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/3644/npm-package-wrangler-3644 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5612709932/npm-package-wrangler-3644 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5612709932/npm-package-cloudflare-pages-shared-3644 Note that these links will no longer work once the GitHub Actions artifact expires. |
Codecov Report
@@ Coverage Diff @@
## main #3644 +/- ##
==========================================
+ Coverage 75.19% 75.24% +0.04%
==========================================
Files 190 190
Lines 11161 11161
Branches 2944 2944
==========================================
+ Hits 8393 8398 +5
+ Misses 2768 2763 -5 |
} catch (err) {} | ||
|
||
return "main"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the user chose to not use git? Will the default main
still work or should we throw a better error than the potential crash would?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pages needs a "production branch" even if git isn't used (e.g. for direct uploads). It is used as a tag for the production environment. So I think this is OK.
We should move this return statement inside the catch block, though, rather than having an empty catch block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll default to the current behavior. We need to supply a --productionBranch
argument to the pages create command, otherwise the call to wrangler pages project create
will fail when it demands interactive input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor suggestions
* C3: Detect production branch when creating pages project * changeset * Addressing PR feedback
Fixes #3637.
What this PR solves / how to test:
This fixes an issue where pages project will fail to be created properly if the user has a different default branch name configured other than
main
. That's because the production branch is currently hardcoded. This fixes it by detecting the current branch and passing that along towrangler pages project create
.Associated docs issue(s)/PR(s):
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable: