refactor: remove appendProjectArgs and simplify personal account retry - #299
Conversation
The --project flag fallback was added as a workaround for personal account scope errors, but VERCEL_PROJECT_ID set in env is sufficient for the retry path. Remove the helper and update the warning message to reflect that VERCEL_PROJECT_ID remains active after clearing VERCEL_ORG_ID.
Add \$schema reference, remove deprecated version field and github.enabled config that is no longer needed in modern Vercel config.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request streamlines the Vercel deployment action by refactoring its core logic and updating an example configuration. The primary goal is to simplify the handling of personal Vercel accounts during deployment, ensuring correct behavior without unnecessary workarounds, and to modernize the example Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Deploy preview for express-basic-auth ready! ✅ Preview Built with commit 1ff65db. |
There was a problem hiding this comment.
Code Review
This pull request updates the vercel.json configuration by adding a schema definition and removing deprecated fields such as version and github settings. It also refactors index.js by removing the appendProjectArgs function and its calls, simplifying the logic for handling Vercel project IDs during deployment. The warning message for retrying deployments without an organization ID has been updated to reflect these changes. I have no feedback to provide.
There was a problem hiding this comment.
No issues found across 3 files
Requires human review: This PR modifies core deployment logic and retry behavior, relying on specific assumptions about Vercel CLI environment variable handling that require manual verification.
Architecture diagram
sequenceDiagram
participant GH as GitHub Action Process
participant Env as Environment (process.env)
participant CLI as Vercel CLI (npx)
participant API as Vercel API
Note over GH, API: Initial Deployment Attempt
GH->>Env: Get VERCEL_ORG_ID and VERCEL_PROJECT_ID
GH->>GH: Build deployment arguments
GH->>CLI: exec('npx vercel', args)
CLI->>API: POST /v13/deployments (using Org ID)
alt Personal Account Error
API-->>CLI: Error: Org ID not allowed for personal account
CLI-->>GH: Exit with failure
Note over GH, Env: NEW: Simplified Retry Path
GH->>Env: CHANGED: Delete VERCEL_ORG_ID
GH->>GH: CHANGED: Rebuild args (no manual --project injection)
GH->>CLI: exec('npx vercel', retryArgs)
Note over CLI, Env: Vercel CLI automatically reads VERCEL_PROJECT_ID from Env
CLI->>API: POST /v13/deployments (using Project ID)
API-->>CLI: Success
CLI-->>GH: Exit 0
else Success path
API-->>CLI: Success
CLI-->>GH: Exit 0
end
There was a problem hiding this comment.
Pull request overview
This PR refactors the Vercel deploy retry logic by removing the --project flag injection path and relying on VERCEL_PROJECT_ID being preserved in the environment when retrying after clearing VERCEL_ORG_ID. It also modernizes the example static vercel.json configuration.
Changes:
- Remove the
appendProjectArgshelper and all--projectflag injection call sites. - Simplify the personal-account retry path to only clear
VERCEL_ORG_IDand retry with the same deploy args. - Update
example/static/vercel.jsonby adding$schemaand removing deprecated fields/blocks.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| index.js | Removes appendProjectArgs and updates the personal-account retry warning message. |
| dist/index.js | Applies the same refactor to the bundled action output. |
| example/static/vercel.json | Adds $schema and removes deprecated version and github.enabled config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…e retry error context - Add core.setSecret(vercelToken) to prevent token leakage in action logs - Sanitize commit message (strip newlines/quotes) before passing as metadata - Preserve original error output when retry path also fails - Remove core.exportVariable for VERCEL_ORG_ID (process.env delete suffices)
|



Summary
appendProjectArgshelper function fromindex.js(and bundleddist/index.js). The--projectflag workaround is unnecessary becauseVERCEL_PROJECT_IDremains set in the environment after clearingVERCEL_ORG_IDon the retry path.VERCEL_PROJECT_IDis still active.example/static/vercel.json: add$schema, remove deprecatedversionfield and thegithub.enabled: falseblock.Changes
index.js/dist/index.js: deleteappendProjectArgs, remove conditionalappendProjectArgscall before scope block, removeappendProjectArgscall in retry path, update warning text.example/static/vercel.json: add schema URL, dropversion: 2andgithubobject.Test plan
vercel.json.