Skip to content

fix: pages github deployment not triggering due to incorrect condition#344

Merged
Maximo-Guk merged 1 commit intocloudflare:mainfrom
alcpereira:fix/pages-gh-deployment
Jan 17, 2025
Merged

fix: pages github deployment not triggering due to incorrect condition#344
Maximo-Guk merged 1 commit intocloudflare:mainfrom
alcpereira:fix/pages-gh-deployment

Conversation

@alcpereira
Copy link
Contributor

@alcpereira alcpereira commented Jan 17, 2025

Description

After a few tries on different repos, and after a migration from cloudflare/pages-action to cloudflare/wrangler-action, the feature to add Github deployment and summary is not working.

How to reproduce

# Force a wrangler deploy similar to CI
CLOUDFLARE_API_TOKEN=xxx WRANGLER_OUTPUT_FILE_DIRECTORY=tmp CI=true \
npx wrangler pages deploy ./dist --project-name=my-project --branch=test/branch-deployment
# Checking stages key
cat tmp/wrangler-output-xxx.json | jq 'select(.type == "pages-deploy-detailed") | .stages'
# null

Solution

Remove the conditional for stages as it's optional, not used in the action and currently preventing the Summary/Deployment to be generated.

@alcpereira alcpereira requested review from a team as code owners January 17, 2025 11:52
@alcpereira alcpereira changed the title fix: pages github deployment not triggering due to missing pages artifact stages fix: pages github deployment not triggering due to incorrect condition Jan 17, 2025
@Maximo-Guk Maximo-Guk merged commit 923db6f into cloudflare:main Jan 17, 2025
@Maximo-Guk
Copy link
Member

Thank you so much @alcpereira 👏!

I went ahead and merged your changes. Just added a changeset, as well as modified the zod schema to remove the stages field, that should never have been included in the schema as it was never added in the original wrangler PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants