Atticus
Atticus

Reputation: 217

Error: Vercel - Git author must have access to the project on Vercel to create deployments

enter image description here

I am developing a project with next.js. The project is kept in a secret repository in the company's github account and my github account is authorized in this repository as colabrator. The project's development domain is also connected to the company's vercel account. We can see the changes we make from here.

However, I have been experiencing a problem for two days. When I add new branches, vercel does not give me access to my github account. As far as I understand, the company needs to switch to a pro account.

Despite this, yesterday we re-authenticated GitHub in to Vercel and the new branch I pushed was deployed without errors. I am trying again today and it does not work. I need to merge the new features of the project but I cannot.

Upvotes: 15

Views: 23609

Answers (12)

Moin Mattar
Moin Mattar

Reputation: 1

I faced a similar issue when trying to update a deployment, and I received the error message: "A commit author is required." This typically happens when the deployment service requires a valid author for the commit being referenced. Here’s how you can resolve this issue:

Make a Commit with Author Information: If you need to specify an author for a specific commit, you can do so using the --author flag:

   git commit --author="Your Name <[email protected]>" -m "Your commit message"

Push Your Changes:

git push

Create the Deployment: Now, when you create the deployment, ensure you reference the correct commit or branch. The deployment service should no longer show the "A commit author is required" error.

good luck!

Upvotes: -1

darrendev
darrendev

Reputation: 342

I didn't see this answer mentioned but this is what worked for me:

  • Click on user profile icon in top right corner
  • Click "Account Settings"
  • Go to "Authentication"
  • Add your Github account as authentication
  • Log out
  • Log back in to Vercel using this github account

Then deployment works

Upvotes: 2

Felipe P&#234;pe
Felipe P&#234;pe

Reputation: 61

I had that problem and found a good solution that doesn't need the 'git config user.email' approach. So your commits will still be under your own Github account and count for your statistics.

You need to add the Deploy Hook URL to GitHub:

  1. In Vercel's Project go to → Settings → Git → Deploy Hooks
  2. Create a hook with any name you want, and in the main branch
  3. Copy the URL
  4. Go to GitHub's Repository and then to → Settings → Webhooks → Add webhook 5. Paste the URL you copied 6. Select Content type: application/json 7. Select "Just the push event" 8. Select Enable SSL verification
  5. Add webhook

Now your Vercel deployments will start automatically when you push to your repository's main.

Upvotes: 6

Zts0hg
Zts0hg

Reputation: 161

A solution works for me.

  1. Go to you vercel project setting (url likes 'https://vercel.com/your-team/your-project-name/settings/git')
  2. Find 【Deploy Hooks】, if there is no hook, just create one, and the code update would sync to Vercel.

Background that I faced the issue: I deploy a project on Vercel and work well. Today I update my code in git repo and appear the error message. Last time I update code in 60 days ago, and I do nothing change during the days. So I guess maybe Vercel update some project config options or my project configuration somehow changed.

Upvotes: 16

yoty66
yoty66

Reputation: 746

A non scalable solution (it's de facto not a ci/cd) is to create a meaningless commit in the repo from the Vercel git owner. I personally did it directly from the git web console just to update the project.

Main drawbacks:

  • it's not a ci/cd
  • it creates a lot of "garbage" commits

Main advantages:

  • no need for the paid tier
  • it doesn't require any setup to trigger a deployment

Upvotes: 0

Priyangsu Banerjee
Priyangsu Banerjee

Reputation: 83

It appears that many of us are facing the same issue. After posting a question in the community, I learned that collaboration is not permitted under the Hobby plan. This was previously allowed due to a bug, but Vercel has recently implemented a fix.

Browse vercel community topic

The only solution is to upgrade to the Pro plan, or do the final commit through the GitHub account that is directly linked to your Vercel account.

For a single project you can achieve this by git config user.email "vercel account email"

Or you may choose to do it globally sudo git config --global user.email "vercel account email"

Upvotes: 7

wkijedi
wkijedi

Reputation: 79

Click on the Details Link that is appearing below on the error. It will redirect you to a vercel page requesting access. If your vercel account is logged in, it will automatically give you access.

You should then make a change in code and push it. Your vercel will be working now.

Upvotes: 3

zaid denthoo
zaid denthoo

Reputation: 31

A week ago i started facing the same issue it seems like Vercel doesn't offer collaboration in the Free Tier anymore. There are 2 solutions to this problem :

  1. Simply buy a pro plan for $20 dollars.
  2. git config user.email "email" (of vercel account linked) DRAWBACK: Although git config solution is a workaround, but all commits will appear under the linked Vercel account.

Upvotes: 3

Priyanka Thangamuthu
Priyanka Thangamuthu

Reputation: 71

Switching to an automated CI/CD pipeline with GitHub Actions and triggering deployments via the Vercel CLI has resolved this issue.

Steps to Fix:

  1. Go to GitHub -> Repository Settings -> GitHub Apps -> Vercel Config and either suspend or remove the integration.
  2. Log into your Vercel account to retrieve your Vercel token, Project ID, and Vercel ID. Add these to GitHub secrets under Settings -> Secrets and Variables -> Actions. Screenshot
  3. Configure your GitHub workflow using the template provided in the Vercel documentation.
  4. Once you commit your changes, GitHub will automatically trigger the deployment.
  5. Deployment success screenshot

Upvotes: 7

Kaspar L. Palgi
Kaspar L. Palgi

Reputation: 1502

I prefer to have my email and do everything under my name and email address so everything goes under my Github statistics and everybody sees what I did when developing with multiple developers so I don't like the `git config user.email "[email protected]" approach and I commit a failed deployment and when I want to deploy, I have a GitHub account logged in in another browser that can commit to Vercel. There I do a dummy README space/space removal commit in the browser and deploy.

To automate a process where a dummy commit is made using a specific email when a commit is made by someone not using Vercel email I have created a .github/workflows/dummy-commit.yml:

name: Dummy commit if someone else than [email protected]

on:
  push:
    branches:
      - main # Replace with your branch

jobs:
  enforce-email:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Get commit email
        id: get_email
        run: |
          email=$(git log -1 --pretty=format:'%ae')
          echo "Commit email: $email"
          echo "email=$email" >> $GITHUB_ENV

      - name: Check email and perform dummy commit if necessary
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          EMAIL: ${{ env.email }}
        run: |
          if [ "${{ env.EMAIL }}" != "[email protected]" ]; then
            echo "Email does not match. Performing dummy commit."
            git config user.name "username or Name Surname"
            git config user.email "[email protected]"
            echo "Dummy commit at $(date)" > dummyfile.txt
            git add dummyfile.txt
            git commit -m "Dummy commit to deploy"
            git push
          else
            echo "Email matches. No action needed."
          fi

Now, create in your project's root a dummyfile.txt and replace [email protected] in 2 places and username or Name Surname with the Vercel hobby plan Github email/username (or name). Also, replace the main branch if needed. Also, give permissions:

Settings -> Actions -> General -> Workflow permissions

It works, and I'm in a hurry now, but I also plan to squash the dummy commit with the commit that triggered it so as not to clutter the commit history with every second commit being a dummy. I'll update here when done.

Upvotes: 3

Jouhar
Jouhar

Reputation: 1510

I faced exact same issue and this is how I solved this. Created a new commit by setting git config user email as the vercel platform owner email ID and it worked

for example ; Suppose your vercel owner email ID is [email protected]. make a small change in the code (like adding a space or something). enter following command in terminal and then push to git. Now you will be able to deploy from that specific commit

git config  user.email "[email protected]"

Upvotes: 16

Akash Panda
Akash Panda

Reputation: 57

I guess you need to ensure that your GitHub account is still properly authorized to access the repository.

Also try double-checking the project settings in Vercel. Navigate to the Git Integration settings and see if the new branches are properly set up for deployment.

If none of this works try deploying manually. Manually create deployments by commit or branch in the dashboard

Upvotes: 3

Related Questions