deploy-to-vercel-action
deploy-to-vercel-action copied to clipboard
Fix: replaced the ref sent to Vercel set in `githubCommitRef` by the branch name
When deploying on a commit event, the ref is in the form refs/heads/${branch} (see github context docs) which is not consistent with the way Vercel works
⚠️ This PR has not seen any activity in the past 2 months so I'm marking it as stale. I'll close it if it doesn't see any activity in the coming week.
Just preventing the bot to close this
⚠️ This PR has not seen any activity in the past 2 months so I'm marking it as stale. I'll close it if it doesn't see any activity in the coming week.
Once again, just preventing the bot to close this. @BetaHuhn could you please check this out?
⚠️ This PR has not seen any activity in the past 2 months so I'm marking it as stale. I'll close it if it doesn't see any activity in the coming week.
Once again, just preventing the bot to close this. @BetaHuhn could you please check this out?
which is not consistent with the way Vercel works
@Elindorath could you elaborate on this?
@BetaHuhn
When github.ref is used (e.g. push trigger), then GH adds the prefix refs/heads/ (e.g. push on foo-bar outputs ref context refs/heads/foo-bar ). This will be visible in the Vercel deployments instead of the 'clear' branch name, e.g. foo-bar (which the default GitHub Action Vercel Bot is using/showing). PR triggers with github.head_ref are not adding the prefix, just the branch name.
One huge issue (despite the cosmetics) comes with the use of preview environments per branch on Vercel. You cannot link a preview environment variable to the deployed branch refs/heads/foo-bar. This is can't be found on Vercel when the project is linked with GitHub; only foo-bar.
I hope this helps 😃
Oops, sorry, didn't see your question @BetaHuhn But I see wagnertimo did a good job at explaining the issue 😉 Thanks
I am dealing with the same issue where, I have setup staging environment by pointing a preview branch of name staging to a custom domain.
It was working fine with the official vercel app integration but this action prefixes the branch by refs/head which results in vercel not being able to track the staging branch.
@BetaHuhn @wagnertimo please can you guys get this PR merged?
Is it possible to merge this pr? We are experiencing the same issue. @BetaHuhn @wagnertimo thanks!
Hey @shehroze-1122 and @MartinLupa thx for your interest and request but unfortunately I am not the owner of this repo and have no permission to merge 😞 Please @BetaHuhn look into this... it's a small but powerful change! Thank you
Thanks for all your solutions! I have forked this project and published a fixed version that you can use out of box: https://github.com/EvanNotFound/vercel-deployment-for-github-actions
If you need it, feel free to check it out!
I just updated this PR with the last changes on the repo and made the enhancement suggested by @wagnertimo (thanks btw 😉). @BetaHuhn don't hesitate to tell me if there is something blocking this to be merged.