mirror of
https://github.com/status-im/status-github-bot.git
synced 2025-02-16 15:17:18 +00:00
Read .pem from environment variable
This commit is contained in:
parent
dc0dd954a4
commit
3a9877ee12
@ -37,19 +37,10 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
const pemFilePath = './status-github-bot.pem';
|
||||
|
||||
const jwtLib = require('jwt-simple');
|
||||
|
||||
// Private key contents
|
||||
let privateKey = '';
|
||||
try {
|
||||
const fs = require('fs');
|
||||
privateKey = fs.readFileSync(pemFilePath);
|
||||
} catch (err) {
|
||||
robot.logger.error(`Couldn't read ${pemFilePath} file contents: ${err}`);
|
||||
return;
|
||||
}
|
||||
let privateKey = process.env.GITHUB_PEM;
|
||||
|
||||
const now = Math.round(Date.now() / 1000);
|
||||
// Generate the JWT
|
||||
|
Loading…
x
Reference in New Issue
Block a user