-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Branch name being assigned refs/heads instead of just the branch name #137
Comments
-> Because vercel built your code, not github actions. Vercel deploys a static file so it can't take more than 1 minute. |
I think maybe my wording wasn't the best, so let me try explaining it in a different way. Vercel - Without Github actions This is how deployments look like without using Github actions. One unique URL is generated, and a branch url. Notice that the branch name on vercel here is fix/cm-section-title So we end up with two domains if we do not use Github actions at all:
However if we were to use this vercel-action and use the alias-domains property We end up with the two domains above and a third domain: In addition the Branch name is no longer fix/cm-section-title, it is now refs/heads/fix/cm-section-title So using alias-domains causes the branch refs/heads/ being prefixed to the Vercel branch name. This in turn causes problems cause we do the build step, not on GitHub Actions but on Vercel..for reasons explained below Does this make any sense ? As you mentioned, yes we are doing the build step on Vercel and not on Github Actions. Which does seem counter intuitive, but it is not by choice. We initially tried building using Github actions, but the build step fails cause we need access to the Vercel System Variables in the build step during build time, which I don't think we have access to if we use GitHub Actions. Sure, you can add them as secrets, but for dynamic variables it is a different situation. We are using the next-auth library for authentication and it needs to know about the AUTH0_BASE_URL during the build step. This variable depends on you guessed it... Vercel system variables. Here is an example what it looks like: Branch URLs (For Develop) Production URL Here is a concrete example of an Environment File example from next-auth0 If we can access all these system variables in Github actions, great. Then we can do the build on GitHub Actions and skip the vercel step and maybe that fixes it. But I am not sure. Sorry, this explanation might just confuse you even more. But in short:
|
Hi, I have been having problems with branch names on deployments.
Let's say I am on the branch hello-world. Git project name is project and teamname is myteam and I am deploying to vercel using this github-action.
This will cause three domains to deploy on vercel:
project-git-1234uniqueid-myteam.vercel.app
project-git-hello-world-myteam.vercel.app
project-git-refs-headshello-world-myteam.vercel.app
Under Branch in Vercel the branch name is now specified as refs/heads/hello-world
if I Disable Vercel for GitHub by setting the flag to true:
{ "github": { "enabled": true } }
The branch is now set to hello-world without the refs/heads part and only the unique url and the branch url domain is set.
For reference this is how my vercel-action part looks like for me;
Did I make any mistake or is there maybe a way to fix this ? This is causing problems with authentication as it relies on branch url not having the refs/heads part.
The text was updated successfully, but these errors were encountered: