2022-04-08 20:59:11 +02:00
|
|
|
/* eslint-env node */
|
|
|
|
|
|
|
|
const fs = require('fs');
|
|
|
|
const createPRComment = require('./createPRComment');
|
2022-05-06 18:56:12 +02:00
|
|
|
const template = require('../.github/workflows/statoscope-comment');
|
2022-04-08 20:59:11 +02:00
|
|
|
|
2022-04-19 15:11:48 +02:00
|
|
|
module.exports = async ({ github, context }) => {
|
2022-04-08 20:59:11 +02:00
|
|
|
const data = JSON.parse(fs.readFileSync('result.json', 'utf8'));
|
|
|
|
data.prNumber = context.issue.number;
|
|
|
|
const body = template(data);
|
|
|
|
|
2022-04-19 15:11:48 +02:00
|
|
|
await createPRComment({ github, context, body });
|
2022-04-08 20:59:11 +02:00
|
|
|
};
|