Address Benjie's review feedback#56
Draft
magicmark wants to merge 1 commit into
Draft
Conversation
- Add explicit ref: main to checkout step (prevents config poisoning) - Include commit hash in wrangler deploy message for traceability - Extract hide-old-comments logic to .github/scripts/hide-old-deploy-comments.mjs - Add .github/scripts to sparse-checkout so the extracted script is available - Add security comments documenting zip-slip safety and static-only wrangler model
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gaps | 18c0148 | Commit Preview URL Branch Preview URL |
Jun 25 2026, 05:26 AM |
benjie
reviewed
Jun 25, 2026
| // Called from preview-deploy.yml via actions/github-script. | ||
|
|
||
| export default async function run({ github, context, prNumber }) { | ||
| const { data: comments } = await github.rest.issues.listComments({ |
Member
There was a problem hiding this comment.
per_page defaults to 30, so this will only find the comments to update if in the first 30.
|
|
||
| await Promise.all( | ||
| comments | ||
| .filter((c) => c.body.includes("<!-- deploy-preview -->")) |
Member
There was a problem hiding this comment.
When people reply to GitHub notification emails it often includes a copy of the previous message - if it copies this from the bot's message then their comment will also be hidden.
Suggest you also filter by author.
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
| command: versions upload --preview-alias "pr-${{ steps.pr.outputs.number }}" --message "PR #${{ steps.pr.outputs.number }} preview" | ||
| command: versions upload --preview-alias "pr-${{ steps.pr.outputs.number }}" --message "PR #${{ steps.pr.outputs.number }} preview (${{ github.event.workflow_run.head_sha }})" |
Member
There was a problem hiding this comment.
Does wranger versions upload do a pure upload, or might it read any configuration/run any scripts/be influenced by any content from within _site?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the review comments from benjie on #40:
ref: mainon checkout step — makes it explicit we're pulling trusted config from main, not from the PR branch(${{ github.event.workflow_run.head_sha }})for traceability.github/scripts/hide-old-deploy-comments.mjs(also adds.github/scriptsto sparse-checkout so it's available at runtime)actions/download-artifacthandles extraction safelyAll changes verified end-to-end on magicmark/gaps-website-test-1 with both fork and non-fork PRs deploying successfully to Cloudflare Workers.