{"id":50669122,"url":"https://github.com/wiyco/vercel-deploy-comment","last_synced_at":"2026-06-08T09:03:51.085Z","repository":{"id":352831593,"uuid":"1214800152","full_name":"wiyco/vercel-deploy-comment","owner":"wiyco","description":"▲ Deploy to Vercel via GitHub Actions and leave a beautiful, official-like preview comment on your PRs.","archived":false,"fork":false,"pushed_at":"2026-05-29T21:38:50.000Z","size":618,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-29T23:14:55.911Z","etag":null,"topics":["comments","deployment","github-actions","pull-requests","vercel"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiyco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-19T04:11:50.000Z","updated_at":"2026-05-29T21:38:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wiyco/vercel-deploy-comment","commit_stats":null,"previous_names":["wiyco/vercel-deploy-comment"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/wiyco/vercel-deploy-comment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiyco%2Fvercel-deploy-comment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiyco%2Fvercel-deploy-comment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiyco%2Fvercel-deploy-comment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiyco%2Fvercel-deploy-comment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiyco","download_url":"https://codeload.github.com/wiyco/vercel-deploy-comment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiyco%2Fvercel-deploy-comment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34055273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comments","deployment","github-actions","pull-requests","vercel"],"created_at":"2026-06-08T09:03:50.329Z","updated_at":"2026-06-08T09:03:51.080Z","avatar_url":"https://github.com/wiyco.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vercel Deploy Comment\n\n[![Coverage](docs/assets/coverage.svg)](docs/assets/coverage.svg)\n[![Code to Test Ratio](docs/assets/code-to-test-ratio.svg)](docs/assets/code-to-test-ratio.svg)\n\nDeploy one or more Vercel projects and environments from GitHub Actions and keep a single pull request comment updated.\n\nThe rendered comment looks like this:\n\n| Project | Environment | Status | Preview | Updated (UTC) |\n| :--- | :--- | :--- | :--- | :--- |\n| [web](https://vercel.com/my-team/web) | preview | ✅ [Ready](https://github.com/my-org/my-repo/actions/runs/1234567890) | [Preview](https://web-git-feature-my-team.vercel.app) | 2026-04-19 00:00:00 UTC |\n| [admin](https://vercel.com/my-team/admin) | staging | ✅ [Ready](https://github.com/my-org/my-repo/actions/runs/1234567890) | [Preview](https://admin-git-feature-my-team.vercel.app) | 2026-04-19 00:01:00 UTC |\n\nThe `Environment` column is shown only when at least one row uses a custom environment outside `preview`, `production`, or `development`.\nStatus cells render an emoji plus the linked status label, for example `✅ [Ready](https://github.com/my-org/my-repo/actions/runs/1234567890)`.\nThe `Preview` cell displays a link only when a deployment is `Ready` and has a preview URL. Otherwise, it shows `N/A`.\n\nThis action is project-driven.\n\n## Usage\n\n```yaml\nname: Preview\n\non:\n  pull_request:\n\npermissions:\n  contents: read\n  issues: write # or pull-requests: write\n\njobs:\n  preview:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: pnpm/action-setup@v5\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n      - run: pnpm install --frozen-lockfile\n      - run: npm install --global vercel@latest\n      - uses: wiyco/vercel-deploy-comment@v2 # or pin to a specific commit SHA\n        with:\n          vercel-token: ${{ secrets.VERCEL_TOKEN }}\n          deployments: |\n            [\n              {\n                \"cwd\": \".\",\n                \"projectId\": \"prj-web\",\n                \"orgId\": \"team_123\",\n                \"environment\": \"preview\",\n                \"projectUrl\": \"https://vercel.com/my-team/web\"\n              },\n              {\n                \"cwd\": \".\",\n                \"projectId\": \"prj-web-staging\",\n                \"orgId\": \"team_123\",\n                \"environment\": \"staging\",\n                \"projectUrl\": \"https://vercel.com/my-team/web-staging\"\n              },\n              {\n                \"cwd\": \"admin\",\n                \"projectId\": \"prj-admin\",\n                \"orgId\": \"team_123\",\n                \"environment\": \"preview\",\n                \"projectUrl\": \"https://vercel.com/my-team/admin\"\n              }\n            ]\n```\n\n`deploy-and-comment` requires the Vercel CLI to already be installed and available on `PATH` as `vercel`. This action shells out to the CLI and does not bundle it. `comment-only` does not require the CLI.\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e Jobs or workflow runs that share the same `comment-marker` should update the managed comment serially. Parallel writers are last-writer-wins and can drop rows. See [docs/spec.md#concurrency](docs/spec.md#concurrency).\n\n\u003e [!CAUTION]\n\u003e\n\u003e Pass Vercel credentials through `vercel-token`. This action strips GitHub Actions `INPUT_*` variables from Vercel CLI child processes and injects the token into authenticated steps through `VERCEL_TOKEN`, so action input secrets do not appear in command-line arguments.\n\u003e\n\u003e Other workflow-managed secrets exported through non-`INPUT_*` environment variables still remain visible to `vercel build`. Do not embed tokens in deployment JSON or other workflow commands.\n\nFor each `deploy-and-comment` entry, the action:\n\n1. Copies `cwd` into an isolated temporary workspace, excluding repo-local `.git` and `.vercel`.\n2. Writes `.vercel/project.json` from `projectId` and `orgId`.\n3. Runs `vercel pull --yes --environment \u003cenvironment\u003e`.\n4. Runs `vercel build --yes`.\n5. Runs `vercel deploy --prebuilt`.\n\n\u003e [!NOTE]\n\u003e\n\u003e Multiple `deploy-and-comment` entries within one action invocation run in parallel up to `deployment-concurrency` at a time. Before the deploys start, the managed PR comment is upserted with `In Progress` rows for the current input. As each row resolves, a single in-process writer serializes the managed comment updates for that run and publishes the latest row state.\n\u003e\n\u003e Each row uses an isolated temp workspace, so repo-local `.vercel` state is not shared across projects or environments, including multiple rows that point at the same source `cwd`.\n\n\u003e [!WARNING]\n\u003e\n\u003e `vercel build` runs inside the workflow runner before `vercel deploy --prebuilt` uploads the prebuilt output, so deploy stability depends on the runner's available CPU and memory as well as `deployment-concurrency`. On smaller runners, running multiple builds in parallel can end with `SIGKILL` or a generic failed build even when the project configuration is unchanged. Reduce `deployment-concurrency` or use a larger runner when builds are resource-heavy.\n\n## Inputs\n\nTop-level inputs:\n\n| Input | Required | Description | Default |\n| :--- | :--- | :--- | :--- |\n| `github-token` | No | GitHub token for PR comment APIs. | `github.token` |\n| `vercel-token` | `deploy-and-comment` only | Vercel token for CLI execution and API enrichment. | - |\n| `mode` | No | Selects `deploy-and-comment` or `comment-only`. | `deploy-and-comment` |\n| `deployment-concurrency` | No | Maximum number of `deploy-and-comment` entries to execute at once. | `2` |\n| `deployments` | Yes | Non-empty JSON array of deployment entries. | - |\n| `header` | No | Markdown heading text shown above the table. | `Vercel Preview Deployment` |\n| `footer` | No | Optional Markdown appended below the table. | - |\n| `comment-marker` | No | Stable key for the managed PR comment. | `default` |\n| `status` | No | Fallback action status when Vercel deployment details are unavailable. In `comment-only` mode, `deployments[].status` overrides this value per row. | `success` |\n| `comment-on-failure` | No | When `true`, failed deploy rows replace the temporary `In Progress` rows before the action fails. | `true` |\n\n`deploy-and-comment` entries:\n\n| Field | Required | Description |\n| :--- | :--- | :--- |\n| `cwd` | Yes | Working directory copied into the isolated temporary workspace before running the Vercel CLI. |\n| `projectId` | Yes | Vercel project ID used for project API lookup. |\n| `orgId` | Yes | Vercel organization ID written into `.vercel/project.json`. |\n| `environment` | Yes | Vercel deployment environment passed to `vercel pull`. |\n| `projectUrl` | Yes | Absolute `https://` URL for the Vercel project. |\n| `deploymentUrl` | No | Optional absolute `https://` URL used as a preview URL hint or fallback when resolving deployment metadata. |\n| `displayName` | No | Display override for the project name shown in the PR comment. |\n| `teamId` | No | Optional Vercel team ID used for API enrichment. |\n| `slug` | No | Optional Vercel team or account slug used for API enrichment. |\n\n`comment-only` entries:\n\n| Field | Required | Description |\n| :--- | :--- | :--- |\n| `projectId` | Yes | Vercel project ID used for project API lookup. |\n| `environment` | Yes | Deployment environment rendered in the PR comment. |\n| `projectUrl` | Yes | Absolute `https://` URL for the Vercel project. |\n| `deploymentUrl` | Yes | Absolute `https://` URL for the deployment preview. |\n| `status` | No | Explicit row status for `comment-only`. Allowed values: `ready`, `failed`, `cancelled`, `skipped`, `in_progress`. When set, it overrides Vercel status enrichment and the top-level fallback `status`. |\n| `displayName` | No | Display override for the project name shown in the PR comment. |\n| `teamId` | No | Optional Vercel team ID used for API enrichment. |\n| `slug` | No | Optional Vercel team or account slug used for API enrichment. |\n\n\u003e [!TIP]\n\u003e\n\u003e `projectUrl` and `deploymentUrl` must be absolute `https://` URLs. `http://` links are rejected so untrusted workflow input cannot render insecure or phishing-oriented links into the managed PR comment.\n\u003e\n\u003e `projectId` is the Vercel project ID used for project API lookup.\n`displayName` is only a display override. The action otherwise prefers the Vercel project API name, then deployment metadata, then `projectId`.\n\n\u003e Legacy `deployments[].command` and `deployments[].projectName` are no longer supported.\n\n## Comment-only Mode\n\nUse this form when you already know the `deploymentUrl` and final `status` and do not need Vercel API enrichment:\n\n```yaml\n- uses: wiyco/vercel-deploy-comment@v2\n  with:\n    mode: comment-only\n    deployments: |\n      [\n        {\n          \"projectId\": \"prj_web\",\n          \"environment\": \"preview\",\n          \"projectUrl\": \"https://vercel.com/my-team/web\",\n          \"deploymentUrl\": \"https://web-git-feature-my-team.vercel.app\",\n          \"status\": \"ready\"\n        }\n      ]\n```\n\nPass `vercel-token` in `comment-only` mode when you want Vercel API enrichment for the project name or deployment status:\n\n```yaml\n- uses: wiyco/vercel-deploy-comment@v2\n  with:\n    mode: comment-only\n    vercel-token: ${{ secrets.VERCEL_TOKEN }}\n    deployments: |\n      [\n        {\n          \"projectId\": \"prj_web\",\n          \"environment\": \"preview\",\n          \"projectUrl\": \"https://vercel.com/my-team/web\",\n          \"deploymentUrl\": \"https://web-git-feature-my-team.vercel.app\"\n        }\n      ]\n```\n\n## Outputs\n\n| Output | Description |\n| :--- | :--- |\n| `comment-id` | ID of the created or updated pull request comment. |\n| `comment-url` | URL of the created or updated pull request comment. |\n| `deployment-urls` | JSON array of preview deployment URLs produced for the current `deployments` input, in input order with rows that resolved a preview URL. |\n| `statuses` | JSON array of normalized status keys produced for the current `deployments` input, in input order. Current values are `ready`, `failed`, `cancelled`, `skipped`, `in_progress`, and `unknown`. |\n\n## Notes\n\n- The action stores one hidden comment marker for the whole comment and one hidden marker per row. Row updates are scoped to `projectId + environment`.\n- Rows included in the current `deployments` input are rendered in input order. Existing rows not included in the current run stay in the comment.\n- The exact GitHub and Vercel APIs used by the action are documented in [docs/spec.md#external-api-usage](docs/spec.md#external-api-usage).\n- `issues: write` or `pull-requests: write` is required for the managed pull request comment. See [docs/spec.md#required-workflow-permissions](docs/spec.md#required-workflow-permissions).\n\nFor the full behavior and security model, see [docs/spec.md](docs/spec.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiyco%2Fvercel-deploy-comment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiyco%2Fvercel-deploy-comment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiyco%2Fvercel-deploy-comment/lists"}