Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/auto-answer-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ jobs:
const body = ISSUE_BODY || "";

const octokit = new Octokit({ auth: GITHUB_TOKEN });

// Check if the bot has already commented on this issue to avoid duplicate responses.
const comments = await octokit.paginate(octokit.issues.listComments, {
owner: REPO_OWNER,
repo: REPO_NAME,
issue_number: issueNumber,
per_page: 100
});
const botAlreadyCommented = comments.some(
(comment) => comment.user?.login === "github-actions[bot]"
);
if (botAlreadyCommented) {
console.log("Bot has already commented on this issue. Skipping.");
return;
}

const openai = new AzureOpenAI({
apiKey: AZURE_OPENAI_API_KEY,
endpoint: AZURE_OPENAI_ENDPOINT,
Expand Down