remove unnecessary logging

This commit is contained in:
Ville Saukkonen 2023-04-22 18:06:45 +03:00
parent 6454621f44
commit cc415382f7
3 changed files with 2 additions and 17 deletions

View file

@ -196,22 +196,17 @@ async function createReviewComment(
async function main() {
const prDetails = await getPRDetails();
let diff: string | null;
console.log("Running the action...");
const eventData = JSON.parse(
readFileSync(process.env.GITHUB_EVENT_PATH ?? "", "utf8")
);
console.log("Event data:");
console.log(eventData);
if (eventData.action === "opened") {
console.log("Pull request event");
diff = await getDiff(
prDetails.owner,
prDetails.repo,
prDetails.pull_number
);
} else if (eventData.action === "synchronize") {
console.log("Push event");
console.log(eventData);
const newBaseSha = eventData.before;
const newHeadSha = eventData.after;
@ -227,8 +222,6 @@ async function main() {
.request({ url: response.data.diff_url })
.then((res) => res.data)
: null;
console.log("Diff:");
console.log(diff);
} else {
console.log("Unsupported event:", process.env.GITHUB_EVENT_NAME);
return;