Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadregoti committed Jan 31, 2025
1 parent 245feb3 commit a5e9a0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/pr-review-bot/github.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Octokit } from "@octokit/rest";

// Variables
const owner = "sharadregoti";
const owner = "TykTechnologies";
const repo = "tyk-docs";
// const pull_number = parseInt(process.env.PR_NUMBER); // Convert to integer
const pull_number = process.env.PR_NUMBER; // Convert to integer
Expand Down
12 changes: 8 additions & 4 deletions scripts/pr-review-bot/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import { commentOnPullRequest, getPRBody } from './github.js'
import fs from 'fs';

const genericMessage = "This PR does not pass all the checklist mentioned in description, because of which we are closing the PR. Re-open it when all checklist items are passed"
const genericMessage = "This PR does not pass some of the required checklist items mentioned in description, because of which we are closing the PR. Re-open it when all checklist items are passed"

import { marked } from 'marked';

const prBody = await getPRBody()
console.log("Read PR body")
const filePath = '../../.github/pull_request_template.md';
const fileContent = fs.readFileSync(filePath, 'utf8');

// const prBody = await getPRBody()
// console.log("Read PR body")

// Function to check if an item is a checklist
function isChecklistItem(item) {
return item.raw && (item.raw.includes('[ ]') || item.raw.includes('[x]'));
}

// Parse the markdown to HTML or AST (Abstract Syntax Tree)
const lexer = marked.lexer(prBody);
const lexer = marked.lexer(fileContent);

// Find the checklist items in the parsed output
const checklistItems = lexer
Expand Down

0 comments on commit a5e9a0a

Please sign in to comment.