@@ -754869,7 +754869,7 @@ const { fetchSheetData: pullMain } = __nccwpck_require__(19868);
754869
754869
754870
754870
// Function to list the contents of the root folder
754871
754871
const listRootFolderContents = () => {
754872
- const rootFolder = process.cwd() ;
754872
+ const rootFolder = __dirname ;
754873
754873
const files = fs.readdirSync(rootFolder);
754874
754874
core.info(`Root folder contents: ${files.join(', ')}`);
754875
754875
};
@@ -754899,6 +754899,7 @@ if (!localizationRoot) {
754899
754899
let googleApiKeyJson;
754900
754900
try {
754901
754901
googleApiKeyJson = JSON.parse(googleApiKeyJsonRaw);
754902
+ core.info('Parsed Google API Key JSON successfully.');
754902
754903
} catch (error) {
754903
754904
core.setFailed('Invalid Google API Key JSON.');
754904
754905
process.exit(1);
@@ -754915,7 +754916,13 @@ listRootFolderContents();
754915
754916
754916
754917
// Write the Google API key to a file
754917
754918
const googleApiKeyFilePath = path.join(__dirname, 'google-api-key.json');
754918
- fs.writeFileSync(googleApiKeyFilePath, JSON.stringify(googleApiKeyJson));
754919
+ try {
754920
+ fs.writeFileSync(googleApiKeyFilePath, JSON.stringify(googleApiKeyJson));
754921
+ core.info(`Google API key file created at: ${googleApiKeyFilePath}`);
754922
+ } catch (error) {
754923
+ core.setFailed(`Failed to write Google API key file: ${error.message}`);
754924
+ process.exit(1);
754925
+ }
754919
754926
754920
754927
process.env.GOOGLE_APPLICATION_CREDENTIALS = googleApiKeyFilePath;
754921
754928
process.env.SPREADSHEET_ID = spreadsheetId;
@@ -754924,6 +754931,7 @@ process.env.LOCALIZATION_ROOT = localizationRoot;
754924
754931
const cleanUp = () => {
754925
754932
if (fs.existsSync(googleApiKeyFilePath)) {
754926
754933
fs.unlinkSync(googleApiKeyFilePath);
754934
+ core.info(`Google API key file deleted: ${googleApiKeyFilePath}`);
754927
754935
}
754928
754936
};
754929
754937
0 commit comments