From 88eb06cf63d4a1289cf6d9802fe56b8da91e1eba Mon Sep 17 00:00:00 2001 From: Szymon Dziedzic Date: Thu, 28 Nov 2024 13:07:39 +0100 Subject: [PATCH] [eas-cli] fix warning for gitignored google services file --- packages/eas-cli/src/build/validate.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/eas-cli/src/build/validate.ts b/packages/eas-cli/src/build/validate.ts index 88078fe75e..796d5fe3f3 100644 --- a/packages/eas-cli/src/build/validate.ts +++ b/packages/eas-cli/src/build/validate.ts @@ -27,24 +27,28 @@ export async function checkGoogleServicesFileAsync( if (!googleServicesFilePath) { return; } + const googleServicesEnvVar = + ctx.platform === Platform.ANDROID + ? ctx.env.GOOGLE_SERVICES_JSON + : ctx.env.GOOGLE_SERVICES_INFO_PLIST; const rootDir = path.normalize(await ctx.vcsClient.getRootPathAsync()); const absGoogleServicesFilePath = path.resolve(ctx.projectDir, googleServicesFilePath); if ( (await fs.pathExists(absGoogleServicesFilePath)) && (!isInsideDirectory(absGoogleServicesFilePath, rootDir) || - (await ctx.vcsClient.isFileIgnoredAsync(path.relative(rootDir, absGoogleServicesFilePath)))) + (await ctx.vcsClient.isFileIgnoredAsync( + path.relative(rootDir, absGoogleServicesFilePath) + ))) && + !googleServicesEnvVar ) { Log.warn( `File specified via "${ctx.platform}.googleServicesFile" field in your app.json is not checked in to your repository and won't be uploaded to the builder.` ); Log.warn( - `Use EAS Secret to pass all values that you don't want to include in your version control. ${learnMore( - 'https://docs.expo.dev/build-reference/variables/#using-secrets-in-environment-variables' + `Use EAS file environment variables with secret or sensitive visibility to pass all values that you don't want to include in your version control to build process. ${learnMore( + 'https://docs.expo.dev/eas/environment-variables/#file-environment-variables' )}` ); - Log.warn( - `If you are using that file for compatibility with the classic build service (expo build) you can silence this warning by setting your build profile's env.GOOGLE_SERVICES_FILE in eas.json to any non-empty string.` - ); Log.newLine(); } }