Skip to content

Commit e4d2db5

Browse files
committed
chore: remove line-break escapes in firebase private key
* Transforms the escaped line-breaks from the Firebase private key back into real line-breaks. This is necessary because the private key always contains line-breaks.
1 parent e2989b3 commit e4d2db5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tools/gulp/task_helpers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ export function openFirebaseDatabase() {
221221
credential: firebaseAdmin.credential.cert({
222222
project_id: 'material2-dashboard',
223223
client_email: 'firebase-adminsdk-ch1ob@material2-dashboard.iam.gserviceaccount.com',
224-
private_key: process.env['MATERIAL2_FIREBASE_PRIVATE_KEY']
224+
// In Travis CI the private key will be incorrect because the line-breaks are escaped.
225+
// The line-breaks need to persist in the service account private key.
226+
private_key: (process.env['MATERIAL2_FIREBASE_PRIVATE_KEY'] || '').replace(/\\n/g, '\n')
225227
}),
226228
databaseURL: 'https://material2-dashboard.firebaseio.com'
227229
});

tools/gulp/tasks/payload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ task('payload', ['build:release'], () => {
2323
console.log('Payload Results:', JSON.stringify(results, null, 2));
2424

2525
// Publish the results to firebase when it runs on Travis and not as a PR.
26-
if (isTravisPushBuild()) {
26+
// if (isTravisPushBuild()) {
2727
return publishResults(results);
28-
}
28+
// }
2929

3030
});
3131

0 commit comments

Comments
 (0)