Skip to content

fix(ci): resolve Deploy - Frontend to Vercel and Artifacts failures (#387) - #517

Open
ValJnr-dev1 wants to merge 1 commit into
PromptMintLabs:mainfrom
ValJnr-dev1:fix/issue-387-deploy-action-versions-and-status-double-response
Open

fix(ci): resolve Deploy - Frontend to Vercel and Artifacts failures (#387)#517
ValJnr-dev1 wants to merge 1 commit into
PromptMintLabs:mainfrom
ValJnr-dev1:fix/issue-387-deploy-action-versions-and-status-double-response

Conversation

@ValJnr-dev1

Copy link
Copy Markdown

Summary

Fixes the CI/deploy failures described in issue #387 (SEV-1 auto-rollback ticket).

Root causes and fixes:

1. Non-existent GitHub Actions action versions

The workflow referenced action versions that do not exist on the marketplace, causing every run to fail immediately:

Action Was Now
actions/setup-node @v7 @v4
actions/upload-artifact @v7 @v4
actions/download-artifact @v8 @v4
Vercel deployment vercel/action@v5 (non-existent) amondnet/vercel-action@v42

Applies to both deploy.yml and auto-rollback.yml.

2. Wrong Node.js version

Node 18.x was specified but the project requires Node 22+ (documented in README.md, enforced by scripts/check-local-setup.mjs). Updated to 22 in the two jobs that use it.

3. Wrong package manager (npm vs Yarn 4)

The project uses Yarn 4 Berry (no package-lock.json, only yarn.lock, packageManager field in package.json). The workflow was calling npm ci and npm run build, which fail because there is no lockfile for npm. Fixed to:

  • corepack enable
  • yarn install --immutable
  • yarn build
  • cache: 'yarn'

4. Double res.status(200).json() in api/status.ts

The handler called res.status(200).json() twice — the second call (added for circuitBreakers) was unreachable and would crash the serverless function with "Cannot set headers after they are sent" in any environment that enforces the Node.js HTTP contract. Fixed by merging circuitBreakers into the single versioned response object.

Tests

  • api/status.test.ts: 3/3 ✅
  • src/lib/ops/rollback.test.ts: 16/16 ✅

Files changed

  • .github/workflows/deploy.yml
  • .github/workflows/auto-rollback.yml
  • api/status.ts

Closes #387

- Bump actions/setup-node@v7 → @v4 in deploy.yml (deploy-frontend, generate-sbom)
- Bump actions/upload-artifact@v7 → @v4 in deploy.yml (all five upload steps)
- Bump actions/download-artifact@v8 → @v4 in deploy.yml (all five download steps)
- Replace vercel/action@v5 (non-existent) with amondnet/vercel-action@v42
- Update Node.js version from 18.x → 22 to match project requirements
- Switch install from npm ci → corepack enable && yarn install --immutable
- Switch build command from npm run build → yarn build (project uses Yarn 4)
- Bump actions/setup-node@v7 → @v4 in auto-rollback.yml
- Fix double res.status(200).json() call in api/status.ts by merging
  circuitBreakers into the single versioned response, eliminating the
  'Cannot set headers after they are sent' crash in the serverless function

Closes PromptMintLabs#387
@drips-wave

drips-wave Bot commented Aug 28, 2026

Copy link
Copy Markdown

@ValJnr-dev1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[SEV-1] Automated rollback: Deploy - Frontend to Vercel and Artifacts failure (527593f)

1 participant