Skip to content

Commit

Permalink
fix: update OpenAI endpoint and improve GitHub comment metadata
Browse files Browse the repository at this point in the history
Updated the OpenAI endpoint in mock configuration and refined metadata handling in GitHub comments.
  • Loading branch information
gentlementlegen committed Oct 18, 2024
1 parent ae37864 commit 7da861e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/parser/github-comment-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export class GithubCommentModule implements Module {
// We check this length because GitHub has a comment length limit
if (body.length > GITHUB_COMMENT_PAYLOAD_LIMIT) {
// First, we try to diminish the metadata content to only contain the URL
bodyArray[bodyArray.length - 2] = `\n${getGithubWorkflowRunUrl()}`;
bodyArray[bodyArray.length - 1] = `${createStructuredMetadata("GithubCommentModule", {
workflowUrl: this._encodeHTML(getGithubWorkflowRunUrl()),
})}`;
const newBody = bodyArray.join("");
if (newBody.length <= GITHUB_COMMENT_PAYLOAD_LIMIT) {
return newBody;
Expand Down
2 changes: 1 addition & 1 deletion tests/__mocks__/results/valid-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"openAi": {
"endpoint": "",
"endpoint": "https://api.openai.com/v1",
"model": "gpt-4o"
}
},
Expand Down

0 comments on commit 7da861e

Please sign in to comment.