We have Vercel preview deployments setup for every pull request in Github.
On every pull request the code gets deployed to a Vercel test / acc / prod environment which are coupled to different backends.
For every pull request we want to run some (Cypress) tests against it, but only against the Vercel test environment.
We have this working by using the deployment_status event and specifying it should only run when the environment is test.
jobs:
cypress:
if: github.event.deployment_status.environment == 'Preview – Test'
This will result in a skipped Github run for acc / prod and a pass/fail for the test environment.
However Github only lists the last run in the PR Github checks, this can be either the skipped or the pass/fail run and is depending on which preview environment gets deployed last.
Is there a way to enforce that Github only lists the relevant run?
I tried making that run dynamic and making the test one mandatory but the check still get's overridden if test was not the last deployed Vercel environment.