This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
@AGENTS.md
This is a GitHub Action that deploys projects to Vercel. It's an npm package that integrates with GitHub workflows to automate deployments, providing more control than Vercel's native GitHub integration.
pnpm install # Install dependencies
pnpm start # Run the action locally (node ./index.js)
pnpm run lint # Run ESLint on index.js
pnpm run format # Format code with Prettier
pnpm run format-check # Check code formatting
pnpm test # Run Jest tests
pnpm run all # Run format, lint, package, and test in sequencepnpm run package # Build the action with ncc (outputs to dist/)Important: The dist/ folder must be committed when creating releases. This contains the bundled action code that GitHub Actions will execute.
-
index.js: Main entry point that:
- Reads GitHub Action inputs (vercel-token, github-token, etc.)
- Executes Vercel CLI commands for deployment
- Comments on PRs/commits with deployment URLs
- Handles alias domain assignment
- Manages environment variables for Vercel org/project
-
action.yml: Defines the GitHub Action interface:
- Input parameters configuration
- Output values (preview-url, preview-name)
- Runtime environment (Node.js 20)
@actions/core: GitHub Actions toolkit for inputs/outputs@actions/exec: Execute shell commands@actions/github: GitHub API interactionsvercel: CLI for deploymentsaxios: HTTP requests for alias management
- Action reads configuration from inputs and environment
- Sets up Vercel org/project IDs from
.vercel/directory - Executes
vercelcommand with appropriate flags - Parses deployment URL from output
- Optionally assigns alias domains
- Comments on GitHub PR/commit with deployment info
- Jest is configured but tests are minimal (index.test.js is empty)
- Manual testing through example projects in
example/directory - GitHub Actions workflows test different scenarios
- Vercel Configuration: Projects must have
github.enabled: falsein vercel.json - Project Linking: The
.vercel/directory with org/project IDs must be committed - Build Process: Builds should happen in GitHub Actions, not Vercel
- Backward Compatibility: Maintain support for deprecated "zeit-" prefixed inputs
- Error Handling: Use proper exit codes and clear error messages for CI/CD integration