Skip to content

Commit

Permalink
Added support for multi line findings
Browse files Browse the repository at this point in the history
  • Loading branch information
Brenden Cambier committed Apr 4, 2024
1 parent acc6a6a commit 5836ab5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ async function run() {
// TODO: replace MOCK
// Unique identifief for findings has temporarily been agreed on having a unique Aikido link within the body referencing the unique Aikido finding
const findings = [
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 117, body: 'Test 1 https://app.aikido.dev/finding/123/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 120, body: 'Test 2 https://app.aikido.dev/finding/124/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 124, body: 'Test 3 https://app.aikido.dev/finding/125/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 124, body: 'Test 4 https://app.aikido.dev/finding/126/' }
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 117, start_line: 117, body: 'Test 1 https://app.aikido.dev/finding/127/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 120, start_line: 120, body: 'Test 2 https://app.aikido.dev/finding/128/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 124, start_line: 124, body: 'Test 3 https://app.aikido.dev/finding/129/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 130, start_line: 124, body: 'Test 4 https://app.aikido.dev/finding/130/' }
];
await (0, postReviewComment_1.postFindingsAsReviewComments)(findings);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ async function run(): Promise<void> {
// TODO: replace MOCK
// Unique identifief for findings has temporarily been agreed on having a unique Aikido link within the body referencing the unique Aikido finding
const findings = [
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 117, body: 'Test 1 https://app.aikido.dev/finding/123/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 120, body: 'Test 2 https://app.aikido.dev/finding/124/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 124, body: 'Test 3 https://app.aikido.dev/finding/125/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 124, body: 'Test 4 https://app.aikido.dev/finding/126/' }
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 117, start_line: 117, body: 'Test 1 https://app.aikido.dev/finding/127/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 120, start_line: 120, body: 'Test 2 https://app.aikido.dev/finding/128/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 124, start_line: 124, body: 'Test 3 https://app.aikido.dev/finding/129/' },
{ commit_id: 'fc773d95213d1c1e35acaceac6e37b036abcd09e', path: 'dist/index.js', line: 130, start_line: 124, body: 'Test 4 https://app.aikido.dev/finding/130/' }

]
await postFindingsAsReviewComments(findings);
Expand Down
2 changes: 1 addition & 1 deletion src/postReviewComment.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from '@actions/core';
import * as github from '@actions/github';

type TFinding = { commit_id: string, path: string, line: number, body: string }
type TFinding = { commit_id: string, path: string, line: number, start_line: number, body: string }

const parseUniqueAikidoID = (body: string): string | undefined => {
const regex = new RegExp('.*app\.aikido\.dev\/finding\/(.*)\/.*', 'i');
Expand Down

0 comments on commit 5836ab5

Please sign in to comment.