Skip to content

Add deploy verification guards - #8

Merged
1aeo merged 7 commits into
mainfrom
codex/deploy-verification-guards
Jul 11, 2026
Merged

Add deploy verification guards#8
1aeo merged 7 commits into
mainfrom
codex/deploy-verification-guards

Conversation

@1aeo

@1aeo 1aeo commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a script that compares local HEAD, origin/main, and the latest Cloudflare Pages deployed commit
  • add a schema-triggered deploy preflight so auto-deploy refuses stale or dirty checkouts
  • add lightweight deploy-repo CI for shell syntax plus scheduled/manual deployed-bundle verification when Cloudflare secrets are configured

Notes

  • The dirty-check uses unignored/tracked status, so ignored runtime files like config.env, logs, and generated wrangler.toml remain allowed.
  • The scheduled verifier skips cleanly when Cloudflare secrets are not configured.

Validation

  • find scripts -name '*.sh' -print0 | xargs -0 -n1 bash -n\n- bash -n scripts/verify-deployed-matches-checkout.sh\n- YAML parse for .github/workflows/*.yml\n- jq extraction check against sample deployment JSON\n- git diff --check\n- PII/secrets grep: no real secrets found; existing placeholders only

Summary by CodeRabbit

  • Bug Fixes
    • Prevented automatic deploy updates when the deployment checkout isn’t on the expected commit or is dirty.
    • Added strict verification to ensure the deployed Pages production commit matches the current checked-out code.
  • CI
    • Added deploy CI with Bash syntax validation and shell linting on push/PRs.
    • Added scheduled/manual verification of deployed bundles against the repository state.
  • Chores
    • Added dedicated pnpm workspace/project setup and ignored node_modules/ in Git.

@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_3328a426-ff72-4110-8fac-01d3e629cdf7)

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change adds Bash validation CI, scheduled Cloudflare Pages deployment verification, Wrangler configuration, and a safety gate requiring schema-triggered deployments to use a current clean checkout.

Changes

Deployment safety and verification

Layer / File(s) Summary
Shell syntax validation
.github/workflows/ci.yml
Adds push and pull-request CI for main, checking Bash syntax and selected deployment scripts with ShellCheck.
Deployed bundle verification
.github/workflows/verify-deployed.yml, scripts/verify-deployed-matches-checkout.sh, package.json, pnpm-workspace.yaml, .gitignore
Adds scheduled and manual verification that conditionally compares the Cloudflare Pages production commit with the fetched checkout, using Wrangler and configurable project and Git settings.
Schema-triggered deployment gate
scripts/allium-deploy-update.sh
Prevents automatic deployment unless origin/main matches the checkout and the working tree is clean.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant VerifyWorkflow
  participant VerificationScript
  participant GitRemote
  participant CloudflarePages
  VerifyWorkflow->>VerificationScript: Run verification with Cloudflare settings
  VerificationScript->>GitRemote: Fetch configured branch and resolve HEAD
  VerificationScript->>CloudflarePages: List Pages deployments as JSON
  CloudflarePages-->>VerificationScript: Return production deployment metadata
  VerificationScript-->>VerifyWorkflow: Report matching or mismatching commit
Loading

Poem

A rabbit checks the scripts with care,
Then hops through commits in the air.
Pages replies, “The hashes align!”
Clean checkouts make deploys shine.
CI thumps its paws: “All fine!”

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding deploy verification guards.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/deploy-verification-guards

Comment @coderabbitai help to get the list of available commands.

@1aeo
1aeo force-pushed the codex/deploy-verification-guards branch from fe443fe to 2479492 Compare July 10, 2026 23:59
@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e2d5c427-53a9-4665-9f37-204f73492270)

@1aeo
1aeo marked this pull request as ready for review July 11, 2026 00:32
Comment thread scripts/allium-deploy-update.sh
Comment thread scripts/verify-deployed-matches-checkout.sh
if command -v wrangler >/dev/null 2>&1; then
wrangler "$@"
else
npx --yes wrangler "$@"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback downloads and executes whatever wrangler version npm currently serves while the workflow has CLOUDFLARE_API_TOKEN/CLOUDFLARE_ACCOUNT_ID in its environment. Because the PR adds no package.json/lockfile or version pin, a compromised npm release or dependency would run with those credentials. Pin wrangler through a lockfile-backed install (npm ci before exporting secrets, then execute the local binary) or otherwise pin the exact package version/integrity, and keep the workflow token read-only.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

1-20: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Harden workflow permissions/pinning per zizmor findings.

No top-level permissions: block (defaults to broad token scopes), actions/checkout@v4 isn't pinned to a commit SHA, and persist-credentials isn't disabled. Low risk here since this job only runs bash -n with no secrets, but cheap to fix.

🔧 Proposed fix
 name: Deploy CI

+permissions:
+  contents: read
+
 on:
   push:
     branches: [main]
   pull_request:
     branches: [main]

 jobs:
   shell-syntax:
     name: Shell Syntax
     runs-on: ubuntu-latest
     steps:
       - name: Checkout
-        uses: actions/checkout@v4
+        uses: actions/checkout@v4 # consider pinning to a commit SHA
+        with:
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 1 - 20, Add a top-level permissions
block restricting the workflow token to read-only access, pin the
actions/checkout step to a full commit SHA instead of the mutable `@v4` tag, and
set persist-credentials: false for that checkout. Apply these changes in the
shell-syntax job without altering its Bash validation behavior.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 3-7: Add a top-level concurrency group to the workflow alongside
the existing on triggers, using a workflow- and ref-based group key and
cancel-in-progress enabled so obsolete runs are canceled instead of queued.

In @.github/workflows/verify-deployed.yml:
- Around line 3-6: Add a workflow-level concurrency group to the verification
workflow, covering both the scheduled and workflow_dispatch triggers. Configure
it to use a stable group name and cancel or prevent overlapping runs so
duplicate verifications cannot execute concurrently.
- Around line 13-21: Pin the actions used in the deployment verification job to
immutable commit SHAs instead of floating v4 tags, including actions/checkout
and actions/setup-node; update the checkout configuration to set
persist-credentials: false while retaining fetch-depth: 0, and preserve the
existing Node 20 setup.

In `@scripts/allium-deploy-update.sh`:
- Around line 48-52: Update require_current_deploy_checkout so it does not
permanently change the caller’s working directory: run the checkout verification
commands in a subshell or use git’s directory option. Add a bounded timeout to
the git fetch invocation so network hangs cannot stall deployment indefinitely.

In `@scripts/verify-deployed-matches-checkout.sh`:
- Around line 24-30: Update the jq selector used by the deployment verification
logic to reference the exact case-sensitive Environment, Branch, and Source
fields emitted by wrangler pages deployment list --json, so DEPLOYED_SHA is
populated correctly; also pin the wrangler version used by run_wrangler for
stable output schema.

---

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 1-20: Add a top-level permissions block restricting the workflow
token to read-only access, pin the actions/checkout step to a full commit SHA
instead of the mutable `@v4` tag, and set persist-credentials: false for that
checkout. Apply these changes in the shell-syntax job without altering its Bash
validation behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f48a5afa-2e55-43ce-8eaa-53d749a3960e

📥 Commits

Reviewing files that changed from the base of the PR and between 975b901 and 2479492.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml
  • .github/workflows/verify-deployed.yml
  • scripts/allium-deploy-update.sh
  • scripts/verify-deployed-matches-checkout.sh

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/verify-deployed.yml Outdated
Comment thread .github/workflows/verify-deployed.yml Outdated
Comment thread scripts/allium-deploy-update.sh Outdated
Comment on lines +48 to +52
require_current_deploy_checkout() {
log "Verifying allium-deploy checkout before schema-triggered deploy..."

cd "$DEPLOY_DIR"
git fetch --quiet origin main

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: confirm whether `set -e`/pipefail is active and how DEPLOY_DIR is defined earlier in the file.
fd 'allium-deploy-update.sh' scripts --exec sed -n '1,45p' {}

Repository: 1aeo/allium-deploy

Length of output: 1630


Avoid changing cwd in the guard and add a fetch timeout.

cd "$DEPLOY_DIR" mutates the shell’s working directory for the rest of the script, so this helper isn’t side-effect-free. git fetch --quiet origin main also has no timeout, which can stall the deploy path indefinitely if the network hangs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/allium-deploy-update.sh` around lines 48 - 52, Update
require_current_deploy_checkout so it does not permanently change the caller’s
working directory: run the checkout verification commands in a subshell or use
git’s directory option. Add a bounded timeout to the git fetch invocation so
network hangs cannot stall deployment indefinitely.

Comment thread scripts/verify-deployed-matches-checkout.sh Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Security review

No high-confidence vulnerabilities found in the current diff.

I specifically reviewed the newly added GitHub Actions workflows, Cloudflare Pages verification script, deploy-checkout guard, and new wrangler dependency/lockfile handling. The prior unpinned wrangler concern appears addressed: the workflow now installs an exact wrangler version from pnpm-lock.yaml before Cloudflare credentials are exposed, and the credentialed verifier step uses the local installed binary. pnpm audit --audit-level high also reported no known high-severity advisories.

Residual hardening to consider, but not a confirmed vulnerability from this diff: pin GitHub Actions to immutable commit SHAs for stronger supply-chain defense.

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/verify-deployed-matches-checkout.sh (1)

57-67: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add a timeout to the remote fetch.

The fetch here has no bound, unlike the fetch in scripts/allium-deploy-update.sh (wrapped in run_with_timeout in this same PR). A network hang would stall this check indefinitely.

⏱️ Suggested fix
-git fetch --quiet "$REMOTE" "$BRANCH"
+run_with_timeout 30 git fetch --quiet "$REMOTE" "$BRANCH"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/verify-deployed-matches-checkout.sh` around lines 57 - 67, Wrap the
git fetch in the verification script with the existing run_with_timeout helper,
using the same timeout convention as scripts/allium-deploy-update.sh, while
preserving the current quiet remote and branch arguments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@scripts/verify-deployed-matches-checkout.sh`:
- Around line 57-67: Wrap the git fetch in the verification script with the
existing run_with_timeout helper, using the same timeout convention as
scripts/allium-deploy-update.sh, while preserving the current quiet remote and
branch arguments.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ccd3ce48-6075-4a80-b0eb-3e7ed4ff9943

📥 Commits

Reviewing files that changed from the base of the PR and between 2479492 and 3b5fae2.

📒 Files selected for processing (2)
  • scripts/allium-deploy-update.sh
  • scripts/verify-deployed-matches-checkout.sh

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Security review

No high-confidence vulnerabilities found in the current diff.

Reviewed areas:

  • GitHub Actions workflows: tokens are restricted to contents: read, checkout credentials are not persisted, and actions are pinned by commit SHA.
  • Cloudflare Pages verifier: credentials are only supplied to the verification step after dependencies are installed from the checked-in pnpm lockfile, and the script uses the local pinned wrangler binary when available.
  • Deploy guard changes: the schema-triggered deploy path now requires the deploy checkout to match origin/main and have a clean working tree before running the Pages deploy script.
  • Dependency surface: wrangler is exact-version pinned in package.json/pnpm-lock.yaml; pnpm audit --audit-level high reported no known high-severity advisories.

The prior unpinned wrangler supply-chain concern appears addressed in this head revision.

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

16-28: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding ShellCheck for deeper validation.

bash -n only catches syntax errors, not common bash pitfalls (unquoted expansions, unset variables, etc.) in scripts/allium-deploy-update.sh and scripts/verify-deployed-matches-checkout.sh. Adding a shellcheck step alongside the syntax check would catch more classes of bugs in these deploy-critical scripts.

♻️ Proposed addition
       - name: Check Bash scripts
         run: |
           find scripts -name '*.sh' -print0 | xargs -0 -n1 bash -n
+
+      - name: ShellCheck
+        uses: ludeeus/shellcheck-action@2.0.0
+        with:
+          scandir: './scripts'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 16 - 28, Add a ShellCheck validation
step to the shell-syntax job alongside the existing bash -n check, targeting
scripts/allium-deploy-update.sh and scripts/verify-deployed-matches-checkout.sh
(or all scripts/*.sh) and ensuring ShellCheck is available on the runner before
execution.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 16-28: Add a ShellCheck validation step to the shell-syntax job
alongside the existing bash -n check, targeting scripts/allium-deploy-update.sh
and scripts/verify-deployed-matches-checkout.sh (or all scripts/*.sh) and
ensuring ShellCheck is available on the runner before execution.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1e755944-bc8b-4e36-b309-829ca19c0374

📥 Commits

Reviewing files that changed from the base of the PR and between 3b5fae2 and bd7fa03.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • .github/workflows/verify-deployed.yml
  • .gitignore
  • package.json
  • pnpm-workspace.yaml
  • scripts/verify-deployed-matches-checkout.sh

@1aeo
1aeo force-pushed the codex/deploy-verification-guards branch from bd7fa03 to 2ee4fd7 Compare July 11, 2026 00:58

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Security review

No high-confidence vulnerabilities found in this PR.

Reviewed areas:

  • GitHub Actions permissions and secret exposure: new workflows use contents: read; Cloudflare secrets are only passed to the scheduled/manual verification step, not the PR CI path.
  • Shell command construction: newly added/changed commands quote environment-controlled values and avoid obvious command/path injection in the deploy verification paths.
  • Dependency/supply-chain changes: wrangler is pinned in package.json/pnpm-lock.yaml, GitHub Actions are pinned by commit SHA, and pnpm audit --audit-level low reports no known vulnerabilities.

Residual note: the new verification workflow executes the checked-in verifier with Cloudflare credentials on scheduled/manual runs, so continue treating dependency updates and future verifier-script changes as privileged-code changes.

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/verify-deployed.yml:
- Around line 37-50: Move the Cloudflare secret preflight before Node setup and
the “Install verifier dependencies” step, then expose its result through a job
or step output. Condition Node setup, dependency installation, and “Verify
deployed Pages commit” on that result, while retaining the notice and clean exit
when secrets are absent.
- Around line 28-32: Reorder the workflow steps so pnpm is enabled before the
“Set up Node” step using actions/setup-node; use the existing pnpm setup
mechanism or add pnpm/action-setup, ensuring pnpm is available on PATH before
setup-node’s pnpm cache initialization.

In `@scripts/verify-deployed-matches-checkout.sh`:
- Around line 78-80: Bound the Wrangler deployment-list request with a timeout.
Update the command assigning DEPLOYMENTS_JSON to invoke run_with_timeout around
run_wrangler pages deployment list, preserving the existing project name and
JSON arguments and using the script’s established timeout convention.
- Around line 78-80: Add the `--environment production` flag to the
`run_wrangler pages deployment list` invocation used to populate
`DEPLOYMENTS_JSON`, ensuring Wrangler filters for production deployments
server-side.
- Around line 112-116: The production deployment selector must exclude failed or
canceled entries before choosing a deployment. Update the selector in the
deployment lookup pipeline to require .latest_stage.status == "success"
alongside the existing production branch/environment conditions, then read
Source only from that filtered result.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 42e72adf-6aeb-45c2-9d14-66ee99fd730a

📥 Commits

Reviewing files that changed from the base of the PR and between bd7fa03 and 2ee4fd7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • .github/workflows/verify-deployed.yml
  • .gitignore
  • package.json
  • pnpm-workspace.yaml
  • scripts/allium-deploy-update.sh
  • scripts/verify-deployed-matches-checkout.sh

Comment thread .github/workflows/verify-deployed.yml Outdated
Comment on lines +28 to +32
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '24'
cache: 'pnpm'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the workflow around the cited lines.
git ls-files .github/workflows/verify-deployed.yml
echo '---'
cat -n .github/workflows/verify-deployed.yml | sed -n '1,220p'

echo '--- SEARCH corepack/pnpm/setup-node references ---'
rg -n "corepack|pnpm|setup-node|cache:" .github/workflows/verify-deployed.yml

Repository: 1aeo/allium-deploy

Length of output: 2221


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the workflow file and inspect the relevant job section only.
awk 'NR>=1 && NR<=220 {print NR ":" $0}' .github/workflows/verify-deployed.yml

Repository: 1aeo/allium-deploy

Length of output: 1707


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
p = Path('.github/workflows/verify-deployed.yml')
text = p.read_text()
print(text)
PY

Repository: 1aeo/allium-deploy

Length of output: 1567


🏁 Script executed:

#!/bin/bash
set -euo pipefail

cat -n .github/workflows/verify-deployed.yml | sed -n '1,220p'

Repository: 1aeo/allium-deploy

Length of output: 1916


🏁 Script executed:

#!/bin/bash
set -euo pipefail

cat -n .github/workflows/verify-deployed.yml | sed -n '1,200p'

Repository: 1aeo/allium-deploy

Length of output: 1916


🌐 Web query:

actions/setup-node pnpm cache requires pnpm on PATH setup-node before corepack enable

💡 Result:

Yes, using the caching feature in actions/setup-node with pnpm requires that the pnpm executable be available on the system PATH at the time the action runs [1][2]. If you attempt to use the caching feature (either via explicit configuration or automatic detection) before pnpm is installed and added to the PATH, the action will fail with an error stating that the pnpm executable cannot be located [1][2]. To resolve this and correctly use caching with pnpm, you have two primary approaches: 1. Recommended Approach: Use pnpm/action-setup The most reliable method is to install pnpm using the official pnpm/action-setup action before running actions/setup-node [3][2]. This ensures that the pnpm binary is present on the PATH and ready for the caching logic to interact with it [3]. Example: - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: cache: pnpm 2. Corepack Approach If you prefer using Corepack, you must enable it and ensure the specific version of pnpm is prepared before the actions/setup-node step [4][5]. Because actions/setup-node checks for the pnpm executable during its execution, the Corepack environment must be fully initialized beforehand [1][2]. Note on Automatic Caching In newer versions of actions/setup-node (v5 and later), the action may attempt to automatically enable caching if it detects a packageManager field in your package.json [1][2]. If you are not yet ready to set up pnpm on the PATH or are experiencing issues with automatic caching, you can disable this behavior by setting the following input in your actions/setup-node step [1][2]: with: package-manager-cache: false This prevents the action from failing due to the missing executable, allowing you to configure caching manually or use alternative methods [1][2].

Citations:


Move pnpm setup before setup-node.

actions/setup-node runs pnpm caching before corepack enable, so the cache step can fail because pnpm isn’t on PATH yet. Enable pnpm first (or use pnpm/action-setup), then run setup-node.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/verify-deployed.yml around lines 28 - 32, Reorder the
workflow steps so pnpm is enabled before the “Set up Node” step using
actions/setup-node; use the existing pnpm setup mechanism or add
pnpm/action-setup, ensuring pnpm is available on PATH before setup-node’s pnpm
cache initialization.

Source: MCP tools

Comment thread .github/workflows/verify-deployed.yml
Comment thread scripts/verify-deployed-matches-checkout.sh Outdated
Comment thread scripts/verify-deployed-matches-checkout.sh
@1aeo
1aeo force-pushed the codex/deploy-verification-guards branch from 2ee4fd7 to e27fd84 Compare July 11, 2026 01:08
Comment on lines +55 to +62
- name: Verify deployed Pages commit
if: steps.cloudflare-secrets.outputs.available == 'true'
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
PAGES_PROJECT_NAME: ${{ vars.PAGES_PROJECT_NAME || '1aeo-metrics' }}
run: |
./scripts/verify-deployed-matches-checkout.sh

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This secret-bearing step runs ./scripts/verify-deployed-matches-checkout.sh from the ref checked out earlier. Because the workflow also has workflow_dispatch, a user with permission to manually run Actions can select their own branch/ref; that branch can modify this script and run with CLOUDFLARE_API_TOKEN/CLOUDFLARE_ACCOUNT_ID in the environment. Please either remove manual dispatch or force secret-bearing runs to check out trusted main code and gate the job to main (ideally with a protected Environment for the Cloudflare token).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 30-38: Update the “ShellCheck deploy scripts” step in the workflow
to lint the same complete set of shell scripts covered by the syntax-check step,
rather than hardcoding two filenames. Use a glob or dynamically discovered list
for all scripts/*.sh files, preserving the existing ShellCheck exclusions and
execution flags so newly added scripts are automatically included.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 586cc6a6-e530-4c51-a498-8daa8d5ee9ae

📥 Commits

Reviewing files that changed from the base of the PR and between 2ee4fd7 and e27fd84.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .github/workflows/ci.yml
  • .github/workflows/verify-deployed.yml
  • .gitignore
  • package.json
  • pnpm-workspace.yaml
  • scripts/allium-deploy-update.sh
  • scripts/verify-deployed-matches-checkout.sh

Comment thread .github/workflows/ci.yml Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security review result: no high-confidence vulnerabilities found in this diff.

I reviewed the added GitHub Actions workflows, deploy verification scripts, shell changes, and new pnpm dependency surface for injection, permission-boundary mistakes, secret exposure, and supply-chain risk. The workflows use read-only repository permissions and disabled checkout credential persistence, Cloudflare secrets are only passed to the verification steps that need them, shell arguments in the added scripts are quoted, and pnpm audit --audit-level moderate reported no known vulnerabilities.

Open in Web View Automation 

Sent by Cursor Automation: Find vulnerabilities

@1aeo
1aeo merged commit 647733e into main Jul 11, 2026
4 checks passed
@1aeo
1aeo deleted the codex/deploy-verification-guards branch July 11, 2026 01:23
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