Skip to content

Commit

Permalink
Merge pull request #165 from gentlementlegen/fix/output
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 authored Oct 18, 2024
2 parents 7efb31b + 376be0d commit 7f13e8e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@
}
}
}
}
},
"required": ["evmPrivateEncrypted"]
}
}
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
4 changes: 2 additions & 2 deletions tests/process.issue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DataPurgeModule } from "../src/parser/data-purge-module";
import { FormattingEvaluatorModule } from "../src/parser/formatting-evaluator-module";
import { GithubCommentModule } from "../src/parser/github-comment-module";
import { PermitGenerationModule } from "../src/parser/permit-generation-module";
import { Processor } from "../src/parser/processor";
import { Processor, Result } from "../src/parser/processor";
import { UserExtractorModule } from "../src/parser/user-extractor-module";
import { parseGitHubUrl } from "../src/start";
import { db as mockDb } from "./__mocks__/db";
Expand Down Expand Up @@ -338,7 +338,7 @@ describe("Modules tests", () => {
});
it("Should generate GitHub comment without zero total", async () => {
const githubCommentModule = new GithubCommentModule();
const postBody = await githubCommentModule.getBodyContent(githubCommentAltResults);
const postBody = await githubCommentModule.getBodyContent(githubCommentAltResults as unknown as Result);
expect(postBody).not.toContain("whilefoo");
});

Expand Down

0 comments on commit 7f13e8e

Please sign in to comment.