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.
solution: the solution for us was to purchase the Vercel Pro plan but different solutions are presented in the comments. You can try them before purchase.
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]"
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 "github email"
Or you may choose to do it globally sudo git config --global user.email "github email"
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
1
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:
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.
Thanks for the feedback but the solution for us was to purchase the Vercel Pro plan.