Skip to content

Commit

Permalink
fix: use readFileSync and JSON.parse instead of require in prob…
Browse files Browse the repository at this point in the history
…ot-receive (#1891)
  • Loading branch information
Uzlopak committed Nov 13, 2023
1 parent c0fb103 commit 3219a98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bin/probot-receive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import express, { Router } from "express";
import { config as dotenvConfig } from "dotenv";
dotenvConfig();

import fs from "fs";
import path from "path";
import { randomUUID as uuidv4 } from "crypto";
import program from "commander";
Expand Down Expand Up @@ -86,7 +87,9 @@ async function main() {
);
}

const payload = require(path.resolve(program.payloadPath));
const payload = JSON.parse(
fs.readFileSync(path.resolve(program.payloadPath), "utf8"),
);
const log = getLog({
level: program.logLevel,
logFormat: program.logFormat,
Expand Down

0 comments on commit 3219a98

Please sign in to comment.