Skip to content

Commit 1f64cb0

Browse files
committed
Ensure the existance of google api json
1 parent 9c5bd14 commit 1f64cb0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754904,9 +754904,10 @@ core.info(`Spreadsheet ID: ${spreadsheetId}`);
754904754904
core.info(`Localization Root: ${localizationRoot}`);
754905754905

754906754906
// Write the Google API key to a file
754907-
fs.writeFileSync('google-api-key.json', JSON.stringify(googleApiKeyJson));
754907+
const googleApiKeyFilePath = path.join(__dirname, 'google-api-key.json');
754908+
fs.writeFileSync(googleApiKeyFilePath, JSON.stringify(googleApiKeyJson));
754908754909

754909-
process.env.GOOGLE_APPLICATION_CREDENTIALS = 'google-api-key.json';
754910+
process.env.GOOGLE_APPLICATION_CREDENTIALS = googleApiKeyFilePath;
754910754911
process.env.SPREADSHEET_ID = spreadsheetId;
754911754912
process.env.LOCALIZATION_ROOT = localizationRoot;
754912754913

@@ -754925,7 +754926,7 @@ try {
754925754926
}
754926754927

754927754928
// Clean up the Google API key file
754928-
fs.unlinkSync('google-api-key.json');
754929+
fs.unlinkSync(googleApiKeyFilePath);
754929754930

754930754931
module.exports = __webpack_exports__;
754931754932
/******/ })()

entrypoint.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ core.info(`Spreadsheet ID: ${spreadsheetId}`);
4141
core.info(`Localization Root: ${localizationRoot}`);
4242

4343
// Write the Google API key to a file
44-
fs.writeFileSync('google-api-key.json', JSON.stringify(googleApiKeyJson));
44+
const googleApiKeyFilePath = path.join(__dirname, 'google-api-key.json');
45+
fs.writeFileSync(googleApiKeyFilePath, JSON.stringify(googleApiKeyJson));
4546

46-
process.env.GOOGLE_APPLICATION_CREDENTIALS = 'google-api-key.json';
47+
process.env.GOOGLE_APPLICATION_CREDENTIALS = googleApiKeyFilePath;
4748
process.env.SPREADSHEET_ID = spreadsheetId;
4849
process.env.LOCALIZATION_ROOT = localizationRoot;
4950

@@ -62,4 +63,4 @@ try {
6263
}
6364

6465
// Clean up the Google API key file
65-
fs.unlinkSync('google-api-key.json');
66+
fs.unlinkSync(googleApiKeyFilePath);

0 commit comments

Comments
 (0)