We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc0d803 commit a7f6969Copy full SHA for a7f6969
1 file changed
.github/workflows/auto-answer-issues.yml
@@ -84,6 +84,22 @@ jobs:
84
const body = ISSUE_BODY || "";
85
86
const octokit = new Octokit({ auth: GITHUB_TOKEN });
87
+
88
+ // Check if the bot has already commented on this issue to avoid duplicate responses.
89
+ const comments = await octokit.paginate(octokit.issues.listComments, {
90
+ owner: REPO_OWNER,
91
+ repo: REPO_NAME,
92
+ issue_number: issueNumber,
93
+ per_page: 100
94
+ });
95
+ const botAlreadyCommented = comments.some(
96
+ (comment) => comment.user?.login === "github-actions[bot]"
97
+ );
98
+ if (botAlreadyCommented) {
99
+ console.log("Bot has already commented on this issue. Skipping.");
100
+ return;
101
+ }
102
103
const openai = new AzureOpenAI({
104
apiKey: AZURE_OPENAI_API_KEY,
105
endpoint: AZURE_OPENAI_ENDPOINT,
0 commit comments