{"id":17306724,"url":"https://github.com/evannotfound/vercel-deployment-for-github-actions","last_synced_at":"2026-02-09T21:02:59.754Z","repository":{"id":223077484,"uuid":"759261586","full_name":"EvanNotFound/vercel-deployment-for-github-actions","owner":"EvanNotFound","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-06T13:44:59.000Z","size":585,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-07T15:17:29.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/EvanNotFound.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-18T04:55:48.000Z","updated_at":"2024-05-06T12:59:10.000Z","dependencies_parsed_at":"2024-02-18T05:29:36.859Z","dependency_job_id":"60edcf0e-f62c-4d50-b107-40d31a1c7b1a","html_url":"https://github.com/EvanNotFound/vercel-deployment-for-github-actions","commit_stats":null,"previous_names":["evannotfound/vercel-action"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanNotFound%2Fvercel-deployment-for-github-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanNotFound%2Fvercel-deployment-for-github-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanNotFound%2Fvercel-deployment-for-github-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanNotFound%2Fvercel-deployment-for-github-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvanNotFound","download_url":"https://codeload.github.com/EvanNotFound/vercel-deployment-for-github-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239809431,"owners_count":19700620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-15T11:59:13.340Z","updated_at":"2026-02-09T21:02:59.625Z","avatar_url":"https://github.com/EvanNotFound.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Vercel Deployment for GitHub Actions\n\n[![Node CI](https://github.com/EvanNotFound/vercel-deployment-for-github-actions/workflows/Node%20CI/badge.svg)](https://github.com/EvanNotFound/vercel-deployment-for-github-actions/actions?query=workflow%3A%22Node+CI%22) [![Release CI](https://github.com/EvanNotFound/vercel-deployment-for-github-actions/workflows/Release%20CI/badge.svg)](https://github.com/EvanNotFound/vercel-deployment-for-github-actions/actions?query=workflow%3A%22Release+CI%22) [![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/EvanNotFound/vercel-deployment-for-github-actions/blob/master/LICENSE) \n\nDeploy your project to Vercel using GitHub Actions. Supports PR previews and GitHub deployments.\n\n![pr-comment-screenshot](https://user-images.githubusercontent.com/51766171/111844410-4aeec000-8903-11eb-9e2d-f84c8c89b039.png)\n\n\u003c/div\u003e\n\n## 👋 Introduction\n\n[vercel-deployment-for-github-actions](https://github.com/EvanNotFound/vercel-deployment-for-github-actions) uses GitHub Actions to deploy your project/site to [Vercel](https://vercel.com). It offers more customization than Vercel's GitHub integration in terms of when to deploy your site. Using GitHub Actions [Events](https://docs.github.com/en/actions/reference/events-that-trigger-workflows) you can choose to deploy every commit, only on new releases or even on a cron schedule. The Action can also deploy every PR and comment on it with a custom preview url. It uses the Vercel CLI and can automatically create a Deployment on GitHub as well.\n\n## 🚀 Features\n\nFixed and improved version of [deploy-to-vercel-action](https://github.com/BetaHuhn/deploy-to-vercel-action) with the following features:\n- Vercel branch name is now the same as the GitHub branch name\n\n- Use GitHub Actions events to control when to deploy to Vercel\n- Automatically deploy every pull request\n- Comment on pull requests with a preview link\n- Create a deployment on GitHub\n- Assign custom dynamic domains to each deployment or pr\n- Can deploy Dependabot PRs and optionally even PRs made from forks\n\n## 📚 Usage\n\nBefore you can start using the Action, you have to setup a few Action inputs. Refer to the [configuration](#%EF%B8%8F-configuration) section below for more info.\n\nThen create a `.yml` file in your `.github/workflows` folder (you can find more info about the structure in the [GitHub Docs](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions)) and add the following:\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy CI\non:\n  push:\n    branches: [master]\n  pull_request:\n    types: [opened, synchronize, reopened]\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    if: \"!contains(github.event.head_commit.message, '[skip ci]')\"\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n```\n\n### Versioning\n\nTo always use the latest version of the Action add the `latest` tag to the action name like this:\n\n```yml\nuses: EvanNotFound/vercel-deployment-for-github-actions@latest\n```\n\nIf you want to make sure that your Workflow doesn't suddenly break when a new major version is released, use the `v1` tag instead (recommended usage):\n\n```yml\nuses: EvanNotFound/vercel-deployment-for-github-actions@v1\n```\n\nWith the `v1` tag you will always get the latest non-breaking version which will include potential bug fixes in the future. If you use a specific version, make sure to regularly check if a new version is available, or enable Dependabot.\n\n## ⚙️ Action Inputs\n\nHere are all the inputs [vercel-deployment-for-github-actions](https://github.com/EvanNotFound/vercel-deployment-for-github-actions) takes:\n\n| Key | Value | Required | Default |\n| ------------- | ------------- | ------------- | ------------- |\n| `GITHUB_TOKEN` | GitHub Token to use when creating deployment and comment (more info [below](#tokens)) | **Yes** | N/A |\n| `VERCEL_TOKEN` | Vercel Token to use with the Vercel CLI (more info [below](#tokens)) | **Yes** | N/A |\n| `VERCEL_ORG_ID` | Id of your Vercel Organisation (more info [below](#vercel-project)) | **Yes** | N/A |\n| `VERCEL_PROJECT_ID` | Id of your Vercel project (more info [below](#vercel-project)) | **Yes** | N/A |\n| `GITHUB_DEPLOYMENT` | Create a deployment on GitHub | **No** | true |\n| `GITHUB_DEPLOYMENT_ENV` | Custom environment for the GitHub deployment. | **No** | `Production` or `Preview` |\n| `PRODUCTION` | Create a production deployment on Vercel and GitHub | **No** | true (false for PR deployments) |\n| `DELETE_EXISTING_COMMENT` | Delete existing PR comment when redeploying PR | **No** | true |\n| `CREATE_COMMENT` | Create PR comment when deploying | **No** | true |\n| `ATTACH_COMMIT_METADATA` | Attach metadata about the commit to the Vercel deployment | **No** | true |\n| `TRIM_COMMIT_MESSAGE` | When passing meta data to Vercel deployment, trim the commit message to subject only | **No** | false |\n| `DEPLOY_PR_FROM_FORK` | Allow PRs which originate from a fork to be deployed (more info [below](#deploying-a-pr-made-from-a-fork-or-dependabot)) | **No** | false |\n| `PR_LABELS` | Labels which will be added to the pull request once deployed. Set it to false to turn off | **No** | `deployed` |\n| `ALIAS_DOMAINS` | Alias domain(s) to assign to the deployment (more info [below](#custom-domains)) | **No** | N/A |\n| `PR_PREVIEW_DOMAIN` | Custom preview domain for PRs (more info [below](#custom-domains)) | **No** | N/A |\n| `VERCEL_SCOPE` | Execute commands from a different Vercel team or user | **No** | N/A |\n| `BUILD_ENV` | Provide environment variables to the build step | **No** | N/A |\n| `WORKING_DIRECTORY` | Working directory for the Vercel CLI | **No** | N/A |\n| `FORCE` | Used to skip the build cache. | **No** | false\n| `PREBUILT` | Deploy a prebuilt Vercel Project. | **No** | false\n\n## 🛠️ Configuration\n\nIn order for the Action to interact with GitHub and Vercel on your behalf, you have to specify your GitHub and Vercel Access Tokens as well as your Vercel Organization and Project Id.\n\n### Tokens\n\nYou can generate your GitHub Personal Access token [here](https://github.com/settings/tokens) and your Vercel Token [here](https://vercel.com/account/tokens) and then specify them as `GITHUB_TOKEN` and `VERCEL_TOKEN` in the Actions inputs.\n\n\u003e **Note:** It is recommended to set the tokens as [Repository Secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository).\n\n### Vercel Project\n\nBefore you can start using this Action you have to link your project with [Vercel](https://vercel.com/download) locally.\n\nRun the command `vercel` inside your projects root and follow the steps described by the [Vercel CLI](https://vercel.com/docs/cli).\n\nOnce set up, a new `.vercel` directory will be added to your directory. The `.vercel/project.json` file contains both the organization (`orgId`) and project (`projectId`) id of your project.\n\nYou can then specify them as `VERCEL_ORG_ID` and `VERCEL_PROJECT_ID` in the Actions inputs.\n\n\u003e **Note:** It is recommended to set them as [Repository Secrets](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository).\n\n### Custom Domains\n\nInstead of using the auto generated domain (`name-randomString.vercel.app`) for each deployment, you can specify custom domains. Use the `ALIAS_DOMAINS` input and seperate each domain on a new line like this:\n\n```yml\nALIAS_DOMAINS: |\n  example.com\n  example.now.sh\n```\n\n#### Pro Teams\nIf your team is set up to `Pro`, remember to set the `VERCEL_SCOPE` to the slug of your team. \n```yml\nwith:\n  VERCEL_SCOPE: 'your-team-slug'\n```\nOtherwise, the action will fail trying to deploy custom domains with default account credentials. It will result in request for authorisation and action fail. \nEven if you extend the scope of `VERCEL_TOKEN` to `All non-SAML Team`, without properly set up `VERCEL_SCOPE` the cli will use default account and fail.\n\n\u003e **Note:** You can use `*.vercel.app` or `*.now.sh` without configuration, but any other custom domain needs to be configured in the Vercel Dashboard first\n\nYou can also use any of the following variables anywhere in the domain:\n\n- `{USER}` - the owner of the repository the action was executed in\n- `{REPO}` - the name of the repository the action was executed in\n- `{BRANCH}` - the branch in which the action was triggered\n- `{SHA}` - the most recent commit's sha\n- `{PR}` - the number of the pr the action was triggered from\n\nExamples:\n\n```yml\nALIAS_DOMAINS: |\n  {BRANCH}.example.com\n  {USER}-{REPO}-{SHA}.now.sh\n```\n\nThis is especially useful if you want to change the PR preview domain with the `PR_PREVIEW_DOMAIN` input:\n\n```yml\nPR_PREVIEW_DOMAIN: \"{REPO}-{PR}.now.sh\"\n```\n\n\u003e **Note:** You can only specify one custom domain for `PR_PREVIEW_DOMAIN`\n\n### Deploying a PR made from a fork or Dependabot\n\nBy default this action will not deploy a PR if it originates from a fork (this is also the default behaviour of [Vercel for GitHub](https://vercel.com/docs/git/vercel-for-github?query=git#deployment-authorizations-for-forks)).\n\nIf you want to deploy a PR made from a fork, you have to set `DEPLOY_PR_FROM_FORK` to true and make sure to use the `pull_request_target` event instead of the `pull_request` event, as GitHub doesn't pass any secrets to workflows triggered by `pull_request` on forks (more info in GitHub's [docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-events-for-forked-repositories)).\n\nYou also have to manually checkout the PR branch, as `pull_request_target` runs in the context of the base of the pull request, rather than in the merge commit.\n\nHere's a complete workflow as an example:\n\n```yml\nname: Deploy CI\non:\n  push:\n    branches: [master]\n  pull_request_target:\n    types: [opened, synchronize, reopened]\njobs:\n  vercel:\n    runs-on: ubuntu-latest\n    if: \"!contains(github.event.head_commit.message, '[skip ci]')\"\n    steps:\n      - id: script\n        uses: actions/github-script@v3\n        with:\n          script: |\n            const isPr = [ 'pull_request', 'pull_request_target' ].includes(context.eventName)\n            core.setOutput('ref', isPr ? context.payload.pull_request.head.ref : context.ref)\n            core.setOutput('repo', isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name)\n\n      - name: Checkout\n        uses: actions/checkout@v2\n        with:\n          ref: ${{ steps.script.outputs.ref }}\n          repository: ${{ steps.script.outputs.repo }}\n\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n          DEPLOY_PR_FROM_FORK: true # This has some serious security risks you need be aware of\n```\n\n\u003e **Note:** Since the first of March 2021 workflow runs which are triggered by a Dependabot PR will act as if they are made from a fork and have the same limitations described above (more info in [GitHub's Changelog](https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/)), except that DEPLOY_PR_FROM_FORK doesn't have to be set to true.\n\n## 📖 Examples\n\nHere are a few examples to help you get started!\n\n### Basic Example\n\nThe workflow below will run on every push to master and every time a new PR is created or an existing PR changed. [vercel-deployment-for-github-actions](https://github.com/EvanNotFound/vercel-deployment-for-github-actions) will deploy the master branch to your Vercel production environment and comment on every PR with a preview link to the deployed PR.\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy CI\non:\n  push:\n    branches: [master]\n  pull_request:\n    types: [opened, synchronize, reopened]\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    if: \"!contains(github.event.head_commit.message, '[skip ci]')\"\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n```\n\n### Don't deploy to production\n\nThe workflow below will run on every push to the staging branch. The Action will then deploy it to the preview environment on Vercel.\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy staging CI\non:\n  push:\n    branches: [ staging ]\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    if: \"!contains(github.event.head_commit.message, '[skip ci]')\"\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n          PRODUCTION: false # Don't deploy to production environment\n```\n\n### Deploy on release\n\nThe workflow below will only run after a new release is created on GitHub.\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy CI\non:\n  release:\n    types: [created]\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    if: \"!contains(github.event.head_commit.message, '[skip ci]')\"\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n```\n\n### Assign alias domains\n\nIf you want, [vercel-deployment-for-github-actions](https://github.com/EvanNotFound/vercel-deployment-for-github-actions) can assign multiple domains to each deployment and also change the PR preview domain:\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy CI\non:\n  push:\n    branches: [master]\n  pull_request:\n    types: [opened, synchronize, reopened]\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    if: \"!contains(github.event.head_commit.message, '[skip ci]')\"\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n          ALIAS_DOMAINS: |\n            example.com\n            {BRANCH}.example.com\n          PR_PREVIEW_DOMAIN: \"{REPO}-{PR}.now.sh\"\n```\n\n### Wait for other CI jobs\n\nThe workflow below will wait until your other CI jobs are completed until it will deploy your project to Vercel.\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy CI\non:\n  push:\n    branches: [master]\njobs:\n  build:\n    # Your build job (can be anything you want)\n    # ...\n  lint:\n    # Your lint job (can be anything you want)\n    # ...\n  deploy:\n    needs: [build, lint] # wait for other jobs\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n```\n\n### Deploy without creating pull request comment\n\nThe workflow below will not automatically create a PR comment. This is useful for example when your PR can trigger multiple deployments (think monorepo for example) and you want to take control over PR comment creation by yourself. You can use output produced by this action to build comment by yourself.\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy CI\non:\n  push:\n    branches: [master]\n  pull_request:\n    types: [opened, synchronize, reopened]\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    if: \"!contains(github.event.head_commit.message, '[skip ci]')\"\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Deploy to Vercel Action\n        id: vercel-deploy\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n          CREATE_COMMENT: false\n      - uses: phulsechinmay/rewritable-pr-comment@v0.3.0\n        if: ${{ steps.vercel-deploy.outputs.DEPLOYMENT_CREATED }}\n        with:\n          message: |\n            This pull request has been deployed to Vercel.\n\n            \u003ctable\u003e\n              \u003ctr\u003e\n                \u003ctd\u003e\u003cstrong\u003e✅ Preview:\u003c/strong\u003e\u003c/td\u003e\n                \u003ctd\u003e\u003ca href='${{ steps.vercel-deploy.outputs.PREVIEW_URL }}'\u003e${{ steps.vercel-deploy.outputs.PREVIEW_URL }}\u003c/a\u003e\u003c/td\u003e\n              \u003c/tr\u003e\n              \u003ctr\u003e\n                \u003ctd\u003e\u003cstrong\u003e🔍 Inspect:\u003c/strong\u003e\u003c/td\u003e\n                \u003ctd\u003e\u003ca href='${ steps.vercel-deploy.outputs.DEPLOYMENT_INSPECTOR_URL }'\u003e${ steps.vercel-deploy.outputs.DEPLOYMENT_INSPECTOR_URL }\u003c/a\u003e\u003c/td\u003e\n              \u003c/tr\u003e\n            \u003c/table\u003e\n\n            [View Workflow Logs](${ LOG_URL })\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          COMMENT_IDENTIFIER: 'vercel-deploy'\n```\n\n### Deploy on schedule\n\nThe workflow below will run at the given interval and deploy your project to Vercel.\n\n\u003e Note: You can use any other action to change your project or run your own script before deploying those changes to Vercel\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy CI\non:\n  schedule:\n    - cron:  '0 8 * * 1' # will run every Monday at 8 am\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      # maybe do something else first\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n```\n\n### Deploy Dependabot PRs\n\nAs described in the [Deploying a PR made from a fork or Dependabot](#deploying-a-pr-made-from-a-fork-or-dependabot) section, Pull Requests created by Dependabot behave as if they where created from a fork and thus the Workflow triggered by the `pull_request` event doesn't have access to any secrets.\n\nTo overcome this limitation you can use the `pull_request_target` event and checkout the PR branch manually:\n\n\u003e Note: By default this action doesn't deploy any forks so you can use pull_request_target without any security concerns\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy CI\non:\n  push:\n    branches: [master]\n  pull_request_target:\n    types: [opened, synchronize, reopened]\njobs:\n  vercel:\n    runs-on: ubuntu-latest\n    if: \"!contains(github.event.head_commit.message, '[skip ci]')\"\n    steps:\n      - id: script\n        uses: actions/github-script@v3\n        with:\n          script: |\n            const isPr = [ 'pull_request', 'pull_request_target' ].includes(context.eventName)\n            core.setOutput('ref', isPr ? context.payload.pull_request.head.ref : context.ref)\n            core.setOutput('repo', isPr ? context.payload.pull_request.head.repo.full_name : context.repo.full_name)\n\n      - name: Checkout\n        uses: actions/checkout@v2\n        with:\n          ref: ${{ steps.script.outputs.ref }}\n          repository: ${{ steps.script.outputs.repo }}\n\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@develop\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n```\n\n### Pass environment variables to the build\n\nYou can define the build environment variables when using the action:\n\n**.github/workflows/deploy.yml**\n\n```yml\nname: Deploy CI\non:\n  push:\n    branches: [master]\n  pull_request:\n    types: [opened, synchronize, reopened]\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    if: \"!contains(github.event.head_commit.message, '[skip ci]')\"\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v2\n      - name: Deploy to Vercel Action\n        uses: EvanNotFound/vercel-deployment-for-github-actions@v1\n        with:\n          GITHUB_TOKEN: ${{ secrets.GH_PAT }}\n          VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}\n          VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}\n          VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}\n          BUILD_ENV: |\n            FOO=\"bar\"\n            SOME_TOKEN=\"${{ secrets.SOME_TOKEN }}\"\n```\n\nIf you have an idea for another use case, [create a discussion](https://github.com/EvanNotFound/vercel-deployment-for-github-actions/discussions/new?category=show-and-tell) and maybe I will add it here!\n\n## 💻 Development\n\nIssues and PRs are very welcome!\n\nThe actual source code of this Action is in the `src` folder.\n\n- run `yarn lint` or `npm run lint` to run eslint.\n- run `yarn start` or `npm run start` to run the Action locally.\n- run `yarn build` or `npm run build` to produce a production version of [vercel-deployment-for-github-actions](https://github.com/EvanNotFound/vercel-deployment-for-github-actions) in the `dist` folder.\n\n## ❔ About\n\nThis project was originally written by ([@betahuhn](https://github.com/BetaHuhn)). I took over the project to fix some issues and add new features.\n\n**[vercel-deployment-for-github-actions](https://github.com/EvanNotFound/vercel-deployment-for-github-actions) is in no way affiliated with Vercel.**\n\n## 📄 License\n\nCopyright 2024 Evan Luo\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevannotfound%2Fvercel-deployment-for-github-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevannotfound%2Fvercel-deployment-for-github-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevannotfound%2Fvercel-deployment-for-github-actions/lists"}