Cannot deploy using netlify cli in ci

Hey all i recently migrated my monorepo from nx to turborepo everything has been working well except for this small netlify deploy issue.

Now when I am running the deploy for each project I randomly am receiving an error saying that the current project is not linked however i am providing both the NETLIFY_SITE_ID and NETLIFY_AUTH_TOKEN. they are passed as cli arguments and loaded as an environment variable. I have other deploy targets (AWS Amplify, Azure Static Web Apps, Cloudflare, Vercel, Surge.sh and a few others). They all are still working (using both cli arguments and loaded env varibles) only the netlify cli is failing during ci. locally using the same environment variables i am able to deploy to netlify. only in github actions with turborepo am i not able to deploy. I am deploying 6 applications to netlify and randomly multiple applications are not deploying to netlify. so for instance one will deploy and then the next will show the aforementioned error.

Steps i have completed.

  • updating netlify-cli version from 20 to 22
  • only send SITE_ID and AUTH_TOKEN as environment variables
  • only send SITE_ID and AUTH_TOKEN as cli args
  • send SITE_ID and AUTH_TOKEN as both cli args and environment variables
  • logged SITE_ID and AUTH_TOKEN in ci to make sure the values are correct.

If anyone knows of any direction that i can look in that would be greatly appreciated

Thank you,
Stephan Randle

Hi, @stephansama. Can the issue be reproduce outside the GitHub action?

If not, could you add steps to the action to log the environment variables you are setting for the site id and auth token to see if they are actually being site?

If the issue can be reproduced outside of the GitHub action, would you please share the reproduction steps here?