Describe the problem
For a production Cloudflare Pages deployment (example), the job summary generated by wrangler-action labels the immutable deployment URL as Preview URL and renders an absent branch alias as undefined:
# Deploying with Cloudflare Pages
| Name | Result |
| --- | --- |
| **Last commit:** | 7af4883c |
| **Preview URL**: | https://0a0c3946.msgspec.pages.dev |
| **Branch Preview URL**: | undefined |
The deployment itself is correctly classified and published as production. The misleading labels come from createJobSummary, which always uses Preview URL and Branch Preview URL, even though createGitHubDeploymentAndJobSummary already receives the Pages deployment environment and an optional alias.
Relevant implementation:
|
const octokit = getOctokit(config.GITHUB_TOKEN); |
|
const [createGitHubDeploymentRes, createJobSummaryRes] = |
|
await Promise.allSettled([ |
|
createGitHubDeployment({ |
|
config, |
|
octokit, |
|
deploymentUrl: pagesArtifactFields.url, |
|
productionBranch: pagesArtifactFields.production_branch, |
|
environment: pagesArtifactFields.environment, |
|
deploymentId: pagesArtifactFields.deployment_id, |
|
projectName: pagesArtifactFields.pages_project, |
|
}), |
|
createJobSummary({ |
|
commitHash: |
|
pagesArtifactFields.deployment_trigger.metadata.commit_hash.substring( |
Reproduction
Use cloudflare/wrangler-action for a Pages direct upload targeting the project's production branch and provide gitHubToken so the action generates its GitHub deployment and job summary:
- uses: cloudflare/wrangler-action@v4
with:
accountId: ${{ secrets.CF_ACCOUNT_ID }}
apiToken: ${{ secrets.CF_PAGES_TOKEN }}
command: pages deploy site --project-name=msgspec --branch=cf-pages
gitHubToken: ${{ github.token }}
When cf-pages is the project's configured production branch, the deployment is production but the generated summary still calls its immutable deployment URL a preview URL.
Proposed behavior
Make the generated Pages summary environment-aware:
- For production deployments, label the immutable URL Deployment URL or Production Deployment URL.
- For preview deployments, retain Preview URL.
- Only include Branch Preview URL when an alias URL exists, rather than displaying
undefined.
An additional useful option would be separate controls for GitHub Deployment creation and job-summary generation. Currently, omitting gitHubToken disables both behaviors together.
Describe the problem
For a production Cloudflare Pages deployment (example), the job summary generated by
wrangler-actionlabels the immutable deployment URL as Preview URL and renders an absent branch alias asundefined:The deployment itself is correctly classified and published as production. The misleading labels come from
createJobSummary, which always usesPreview URLandBranch Preview URL, even thoughcreateGitHubDeploymentAndJobSummaryalready receives the Pages deployment environment and an optional alias.Relevant implementation:
wrangler-action/src/service/github.ts
Lines 97 to 111 in a61fbea
Reproduction
Use
cloudflare/wrangler-actionfor a Pages direct upload targeting the project's production branch and providegitHubTokenso the action generates its GitHub deployment and job summary:When
cf-pagesis the project's configured production branch, the deployment is production but the generated summary still calls its immutable deployment URL a preview URL.Proposed behavior
Make the generated Pages summary environment-aware:
undefined.An additional useful option would be separate controls for GitHub Deployment creation and job-summary generation. Currently, omitting
gitHubTokendisables both behaviors together.