vercel-action icon indicating copy to clipboard operation
vercel-action copied to clipboard

Deploy Fails When Trigger is of Type Pull Request

Open dagarcia7 opened this issue 2 years ago • 3 comments

I am getting a "Not Found" error when using the Github Action to kick off a deploy when using the pull request trigger. Here is the output I'm seeing (modified feature branch name and sha to make sure I'm not giving away any unnecessary information):

set environment for vercel cli
set env variable : VERCEL_ORG_ID
set env variable : VERCEL_PROJECT_ID
##[debug]head : [object Object]
##[debug]The head ref is: feature/example-branch
##[debug]The head sha is: example-sha
Error: Not Found

and here is the code from my workflow file:

name: Pull Request Opened, Synchronized, or Reopened

on:
  pull_request

jobs:
  buildAndDeploy:
    # Using Vercel's Github Action to kick off deployments
    # Documentation here: https://github.com/marketplace/actions/vercel-action
    name: Build & Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the current branch
        uses: actions/checkout@v2
      - uses: amondnet/vercel-action@v20
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }} 
          github-token: ${{ secrets.ACTIONS_TOKEN }} 
          vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}  
          vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} 
          scope: ${{ secrets.VERCEL_ORG_ID }}
          github-comment: false

dagarcia7 avatar Feb 28 '22 19:02 dagarcia7

Yeah, this happened to me as well, did you find a solution?

amr3k avatar Apr 15 '22 19:04 amr3k

This happened to me, as well, and ended up being because my GitHub Actions secrets were not properly set up. Maybe verify that you've got all the correct secrets.

McKynlee avatar May 19 '22 19:05 McKynlee

This can happen if you're using a private repo and your Github token doesn't have the necessary scopes.

sbihel avatar Aug 08 '22 16:08 sbihel