amondnet / vercel-action

This action make a deployment with github actions instead of Vercel builder.
https://vercel.com/docs/cli
MIT License
642 stars 100 forks source link

Preview & Deployment URL outputs are null when vercel build fails #262

Open zognotadog opened 2 months ago

zognotadog commented 2 months ago

When the vercel build fails, the preview and deploy outputs are not provided. We are trying to log the build logs in the PR if this happens. We cannot do this without the preview-url. Please can it be change to still output these on failure?

  # Deploy using the build files
  - name: Deploy to Vercel
    id: vercel-deploy
    uses: amondnet/vercel-action@v25 # Deploy to Vercel
    with:
      github-token: ${{ secrets.VERCEL_GITHUB_TOKEN }}  # Optional
      vercel-token: ${{ secrets.VERCEL_TOKEN }}  # Required
      vercel-org-id: ${{ vars.VERCEL_ORG_ID }}   # Required
      vercel-project-id: ${{ vars.VERCEL_PROJECT_ID }}  # Required 
      alias-domains: |
        ${{ 
          github.ref == 'refs/heads/main' && 'app.app.co.uk' || 
          github.ref == 'refs/heads/dev' && 'dev.app.co.uk'
        }}
      github-comment: true

  - name: Log Deployment Outputs
    if: failure()
    run: |
      echo "Deployment URL: ${{ steps.vercel-deploy.outputs.deployment-url }}"
      echo "Preview URL: ${{ steps.vercel-deploy.outputs.preview-url }}"`
BenjaOliva commented 1 month ago

Kind same issue here. The deploy is being done but when trying to log the step.[VERCEL_ACTION_STEP_ID].outputs.preview-url nothing is being shown.

This is avoiding our tests to run over the preview in our CI workflow after preview deployment