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

Deployment fails due to empty `githubCommitRef` #46

Open joonashak opened 4 years ago

joonashak commented 4 years ago

I have a workflow set up to deploy to staging on main branch push and and to production on release. With no changes to the workflow or env vars, the deployment to production started failing today due to an empty value for githubCommitRef:

Screenshot 2020-10-24 at 18 02 15

Deployment to staging still works as it has a correct value of refs/heads/main for githubCommitRef. My previous successful deployment to production was 10 days ago and it had a value of refs/tags/0.0.15.

The failing workflow:

name: Production Deployment (Release)

on:
  release:
    types: [published]

jobs:
  deploy:
    name: Deploy to Production
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Deploy CMS to Heroku
        uses: akhileshns/heroku-deploy@v3.4.6
        with:
          appdir: cms
          heroku_api_key: ${{secrets.HEROKU_API_KEY}}
          heroku_app_name: ${{secrets.HEROKU_PRODUCTION_NAME}}
          heroku_email: ${{secrets.HEROKU_EMAIL}}
      - name: Deploy Frontend to Vercel
        uses: amondnet/vercel-action@v19
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }}
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} 
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}}
          alias-domains: |
            reclab-web.vercel.app
          working-directory: ./web

And the whole repository in question is available here: https://github.com/joonashak/reclab

To my knowledge, I have not changed anything that could have broken this. I tried to take a look at vercel-action codebase but could not figure out if the problem is with this action or my code, and thought that this would be the logical place to start asking questions.

amondnet commented 4 years ago

@joonashak

Please try again with v19.0.1+3 to check if there is a problem with the latest version (v19.0.1+4).

joonashak commented 4 years ago

I just ran the actions for the old failing release again and it failed just as it did before. Then I committed my latest changes and made a new release triggering the workflow but this time it finished successfully. I did not make any changes to the workflow configuration between these releases.

Do you think that this needs to be further investigated even though the pipeline seems to be working now or just let it be unless it happens again? I will be happy to try out the different versions of the action, if it helps.

Celtian commented 3 years ago

Similar issue happens If you use husky in your project.

Error: The process '/usr/local/bin/npx' failed with exit code 1

Workaround is to move this lib into optionals. Luckylly it is possible for husky, but it cannot be possible for more libs. I hope it will be solved as soon as possible.

glrodasz commented 3 years ago

I'm having a similar error and what it is strange is that I haven't changed anything related to the action itself. I though maybe for some reason v19 had a dependency problem so I updated to v20 but still is not working:

image

lukasver commented 1 year ago

Same problem with amondnet/vercel-action@v20 and amondnet/vercel-action@v25.1.0 here

piesuke commented 1 year ago

Same problem with amondnet/vercel-action@v25 This error occurs on any commit, but not on a new commit.