Giter VIP home page Giter VIP logo

vercel-action's Issues

Github Action failing with message "Failed to parse URL from undefined"

This is my workflow file:

name: Vercel Preview Deployment

env:
  VERCEL_ACCESS_TOKEN: ${{ secrets.VERCEL_ACCESS_TOKEN }}
  VERCEL_PROJECT_ID: <project-id>

on:
  pull_request:
    types: [opened, synchronize, closed]

jobs:
  deploy-vercel-preview:
    if: ${{ github.event.action == 'opened' || github.event.action == 'synchronize' }}
    runs-on: ubuntu-latest
    steps:
      - uses: snaplet/vercel-action@v2
  delete-vercel-preview:
    if: ${{ github.event.action == 'closed' }}
    runs-on: ubuntu-latest
    steps:
      - uses: snaplet/vercel-action@v2
        with:
          delete: true

Based on the above workflow file, I'm getting the following error message when a new pull request is created:

Creating deploy hook...
Deploy hook created.
Creating deployment...
node:internal/deps/undici/undici:5573
            throw new TypeError("Failed to parse URL from " + input, { cause: err });
                  ^

TypeError: Failed to parse URL from undefined
    at new Request (node:internal/deps/undici/undici:5573:19)
    at Agent.fetch2 (node:internal/deps/undici/undici:6[37](https://github.com/realtimeskills/oslash/actions/runs/3636809230/jobs/6137131079#step:2:40)1:25)
    ... 2 lines matching cause stack trace ...
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:387:5)
      at URL.onParseError (node:internal/url:565:9)
      at new URL (node:internal/url:641:5)
      at new Request (node:internal/deps/undici/undici:5571:25)
      at Agent.fetch2 (node:internal/deps/undici/undici:6371:25)
      at fetch (node:internal/deps/undici/undici:7200:20)
      at file:///home/runner/work/_actions/snaplet/vercel-action/v2/scripts/deploy.mjs:49:23
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    input: 'undefined',
    code: 'ERR_INVALID_URL'
  }
}
Error: Process completed with exit code 1.

Add VERCEL_URL as an output

It would be cool if this `vercel-action' could output the VERCEL_URL so it can be used by other steps following the deploy like e2e tests and such.

Github is deprecating set-output command

I'm getting a warning in my action that Github is deprecating the set-output command. Setting the deployment URL here should probably write to the GITHUB_OUTPUT environment variable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.