wait-for-vercel-preview icon indicating copy to clipboard operation
wait-for-vercel-preview copied to clipboard

When a build is ignored, the action fails to retrieve the existing deployment

Open erezrokah opened this issue 3 years ago • 5 comments

When one configures an ignore command on Vercel, and pushes a new commit, the action fails to retrieve any existing deployments (shown as outdated on GitHub) if the build is skipped: image image

I tried passing ref here https://github.com/patrickedqvist/wait-for-vercel-preview/blob/1d4a973cb668249d5fb0e34d04be05634e396a8b/action.js#L217 instead of sha (e.g. passing the branch name), but it doesn't seem to work (maybe because Vercel only sets the deployment on commits).

Another solution would be to retrieve previous commits and look for deployments from them, but there could be a race condition here where a new one hasn't appeared yet and we get the stale one.

Not sure what's the proper solution for it

erezrokah avatar Dec 21 '22 10:12 erezrokah

Hi @erezrokah! Did you try adding allow_inactive: true in the action parameters? From what you're describing it seems that should work if there already was a preview in the PR and this setting defaults to false https://github.com/patrickedqvist/wait-for-vercel-preview#allow_inactive

oxfist avatar Jan 09 '23 17:01 oxfist

Hi @oxfist thanks for the reply! We are using allow_inactive: true, however I think the cause is that the action retrieves deployments for a specific sha so if you push a new commit that is ignored on Vercel that commit sha won't have any deployments retrieved by the action (hence my attempt to use ref)

erezrokah avatar Jan 10 '23 08:01 erezrokah

Our current workaround is to re-implement the Vercel ignore logic in our GitHub action workflow and only use wait-for-vercel if we expect a build to be triggered

erezrokah avatar Jan 10 '23 08:01 erezrokah

Hey @erezrokah I'm currently facing the same issue.

Could you share in more details how you solved it?

If it's possible to share a code snippet, that would be great.

MTG2000 avatar Jul 26 '24 09:07 MTG2000

@MTG2000 see https://github.com/cloudquery/cloudquery/blob/88f46fa9c2a370c5b9356184ffce2836c8cb59c6/.github/workflows/broken_links.yml#L30 and https://github.com/cloudquery/cloudquery/blob/88f46fa9c2a370c5b9356184ffce2836c8cb59c6/website/scripts/diff.sh#L1

erezrokah avatar Jul 26 '24 10:07 erezrokah