wait-for-vercel-preview
wait-for-vercel-preview copied to clipboard
Multiple projects / monorepo support?
I am trying to use this in a monorepo, in vercel we can have multiple projects per repo by use of Root Directory
option.
When I use this, the url
output is capturing only the last deploy URL, so jobs that depends on this output uses incorrect URL. There is a way to set which project to listen for the 200 preview?
Just found that I can use environment
option to do exactly this.
Setting it to Preview - name
where name
is the vercel project name solves my problem.
Related #8
@klarkc I'm trying to setup monorepo with this but not sure how this works. I've set environment
like this:
environment: "Preview - app-one"
where app-one
is vercel project name, but it doesn't work for me.
I am trying to use this in a monorepo, in vercel we can have multiple projects per repo by use of
Root Directory
option.
@rodilo did you set the Root Directory option?
@klarkc yes, that part is ok, monorepo deployment works as expected. But this action went into timeout even though deployment was successful.
@rodilo looking at the code:
https://github.com/patrickedqvist/wait-for-vercel-preview/blob/e634c37510fbe9aaefcf0e66c4bcf04d657dc274/index.js#L109
It seems this listing is being fetched from the github deployments API. Maybe if you can somehow test this endpoint by yourself you can see what is the expected environment value for your deployment, this way you can match setting the environment
option of this action.
Probably a vercel breaking change on this naming created this side-effect on my solution.
@rodilo looking at the code:
https://github.com/patrickedqvist/wait-for-vercel-preview/blob/e634c37510fbe9aaefcf0e66c4bcf04d657dc274/index.js#L109
It seems this listing is being fetched from the github deployments API. Maybe if you can somehow test this endpoint by yourself you can see what is the expected environment value for your deployment, this way you can match setting the
environment
option of this action.Probably a vercel breaking change on this naming created this side-effect on my solution.
Thanks, I will 👍
Just to let other people know, this is not working anymore, vercel
just sends deployment environment` without project name.
As it not working anymore, I'm reopening the issue.
Just figure it out. Environment will contain project name only if you have connected multiple projects from a single monorepo. I didn't have it because I've only connected one project from my monorepo repository.
If anyone is stuck on this down the line with trying to get the right environment
name note that it uses the uncommon character –
in-between the deployment environment and the Vercal app name. It's not the normal -
.
Using that character fixed my problems. You can also just copy and paste it from here
In regards to mono-repos on vercel, if you use the ignore build step
, this action will timeout eventually even when the build no vercel was cancelled by the ignore build step
.
@klarkc What are your thoughts on adding an option for the wait job to emit the skip status if the deploy was cancelled?
@trm217 I am not aware of how vercel is working nowadays, maybe someone who is currently using monorepos on vercel would answer this.
It is blocking you of using monorepos? If not I believe I should close this issue and maybe you could open a new issue.
@klarkc No it's not blocking, I was just sharing my thoughts :)