BetaHuhn / deploy-to-vercel-action

🎬▲ Deploy your project to Vercel using GitHub Actions. Supports PR previews and GitHub deployments.
https://mxis.ch
MIT License
141 stars 71 forks source link

PREVIEW defaults to false on pull requests #387

Closed alexflint closed 4 months ago

alexflint commented 5 months ago

🐞 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 4 months ago

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
alexflint commented 4 months ago

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