BetaHuhn/deploy-to-vercel-action

PREVIEW defaults to false on pull requests

alexflint opened this issue ยท 2 comments

๐Ÿž Describe the bug

In the docs you say that the default value for PRODUCTION is "true (false for PR deployments)", but when I use this action from a pull request, it creates a production deployment on vercel.

๐Ÿ“š To Reproduce

Create a pull request on a repository with an ordinary github action like this:

name: Vercel Preview Deployment

on: [push]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      # Check out the code
      - name: Checkout
        uses: actions/checkout@v4

      # Deploy on vercel
      - name: Deploy to Vercel
        uses: BetaHuhn/deploy-to-vercel-action@v1

๐Ÿ’ก Expected behavior

Creates a preview deployment

๐Ÿ–ผ๏ธ Screenshots

N/A

โš™๏ธ Environment

I am using BetaHuhn/deploy-to-vercel-action@v1

๐Ÿ“‹ Additional context

N/A

pm0u commented

i think you want on: pull_request

https://github.com/BetaHuhn/deploy-to-vercel-action/blob/master/src/config.js#L6

or

with:
  PRODUCTION: false

Oh, I see. It's based on the trigger rather than the branch name. Makes sense.