Skip to content

Address Benjie's review feedback on deploy preview#72

Merged
magicmark merged 1 commit into
mainfrom
fix/benjie-review-feedback
Jun 25, 2026
Merged

Address Benjie's review feedback on deploy preview#72
magicmark merged 1 commit into
mainfrom
fix/benjie-review-feedback

Conversation

@magicmark

Copy link
Copy Markdown
Owner

Summary

Applies the fixes suggested in graphql/gaps PR #40 code review by Benjie:

  • Explicit ref: main on checkout - Prevents a malicious PR author from crafting a branch that poisons the wrangler.jsonc config used by the privileged deploy workflow
  • Commit hash in deploy message - Adds ${{ github.event.workflow_run.head_sha }} to the Wrangler versions upload message for traceability
  • Extract inline JS to .github/scripts/ - Moves the "hide old comments" GraphQL mutation logic into hide-old-deploy-comments.mjs for readability and testability
  • Security documentation comments - Documents why zip-slip is not a concern (handled by actions/download-artifact) and why the wrangler deploy is safe (static assets only)

Test plan

  • Open a test PR against this repo and verify the deploy preview workflow still triggers
  • Confirm the deploy comment appears correctly
  • Confirm old deploy comments get minimized
  • Check the Wrangler deploy message includes the commit hash in the Cloudflare dashboard

Context

Testing these fixes in the staging repo before applying to graphql/gaps PR #40.

🤖 Generated with Claude Code

- Add explicit `ref: main` to checkout step to prevent PR authors from
  poisoning the wrangler config via a crafted branch
- Include commit hash in wrangler deploy message for traceability
- Extract hide-old-comments logic into .github/scripts/ for readability
- Add security comments documenting zip-slip safety (handled by
  actions/download-artifact) and static-only wrangler configuration

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Deploy Preview

@magicmark
magicmark merged commit b755d9e into main Jun 25, 2026
2 checks passed
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.

1 participant