Elffuss BraidHub

kikocis/continue public

Merge pull request #7188 from continuedev/tomasz/fix-gh-action-condition

Tomasz/fix gh action condition
Changesetf5ca24cbed080275fa225a0e0ff258012bf59e1006211664b703ffc7e892bf8d
AuthorTomasz Stefaniak <tomasz.p.stefaniak@gmail.com> · 2025-08-18 11:24 -07:00
CommitterGitHub <noreply@github.com> · 2025-08-18 11:24 -07:00
Parentsccf00d6c610c, 6247e8eef992

Browse the files at this changeset

5 files changed

modified .github/workflows/continue-detailed-review.yaml +1 −1
@@ -18,7 +18,7 @@
1818 timeout-minutes: 10
1919 steps:
2020 - name: Run Detailed PR Review
21- uses: continuedev/continue/actions/detailed-review@23d9260536372acf4eb57a41e6ab62bc5869b070
21+ uses: continuedev/continue/actions/detailed-review@64bda6b2b3dac1037e9895dbee4ce1d35565e1fe
2222 with:
2323 continue-api-key: ${{ secrets.CONTINUE_API_KEY }}
2424 continue-org: continuedev
modified .github/workflows/continue-general-review.yaml +1 −1
@@ -18,7 +18,7 @@
1818 timeout-minutes: 10
1919 steps:
2020 - name: Run Continue PR Review Action
21- uses: continuedev/continue/actions/general-review@23d9260536372acf4eb57a41e6ab62bc5869b070
21+ uses: continuedev/continue/actions/general-review@64bda6b2b3dac1037e9895dbee4ce1d35565e1fe
2222 with:
2323 continue-api-key: ${{ secrets.CONTINUE_API_KEY }}
2424 continue-org: "continuedev"
modified actions/README.md +1 −1
@@ -219,7 +219,7 @@
219219 Example:
220220
221221 ```yaml
222-uses: continuedev/continue/actions/general-review@17fe39cc4f1760838ce4428aad0a984af13f8266
222+uses: continuedev/continue/actions/general-review@64bda6b2b3dac1037e9895dbee4ce1d35565e1fe
223223 ```
224224
225225 ## Troubleshooting
modified actions/detailed-review/action.yml +44 −19
@@ -29,12 +29,17 @@
2929 SHOULD_RUN="false"
3030
3131 if [ "${{ github.event_name }}" = "pull_request" ]; then
32- # Check PR author association
33- AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}"
34- if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then
35- SHOULD_RUN="true"
32+ # Check if PR is a draft
33+ if [ "${{ github.event.pull_request.draft }}" = "true" ]; then
34+ echo "::notice::Skipping review - PR is a draft"
3635 else
37- echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)"
36+ # Check PR author association
37+ AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}"
38+ if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then
39+ SHOULD_RUN="true"
40+ else
41+ echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)"
42+ fi
3843 fi
3944 elif [ "${{ github.event_name }}" = "issue_comment" ]; then
4045 # Check if it's a PR comment with the trigger phrase
@@ -268,7 +273,23 @@
268273 console.log('Invalid comments:', JSON.stringify(invalidComments, null, 2));
269274 }
270275
271- const comments = validComments.map(comment => ({
276+ // Deduplicate comments based on path + position + body
277+ const uniqueComments = [];
278+ const seen = new Set();
279+
280+ for (const comment of validComments) {
281+ const key = `${comment.path}:${comment.position}:${comment.body}`;
282+ if (!seen.has(key)) {
283+ seen.add(key);
284+ uniqueComments.push(comment);
285+ }
286+ }
287+
288+ if (uniqueComments.length < validComments.length) {
289+ console.log(`Filtered out ${validComments.length - uniqueComments.length} duplicate comments (same path + position + body)`);
290+ }
291+
292+ const comments = uniqueComments.map(comment => ({
272293 path: comment.path,
273294 position: comment.position,
274295 body: comment.body
@@ -283,12 +304,19 @@
283304 // Create the review
284305 if (comments.length > 0) {
285306 try {
307+ let reviewBody = `${reviewData.review_summary || 'AI Code Review'}\n\n---\n*💡 To request a new detailed review, comment \`@continue-detailed-review\`*`;
308+
309+ // Add triggered by note if from comment
310+ if (context.eventName === 'issue_comment') {
311+ reviewBody = `*Triggered by @${context.payload.comment.user.login}'s request*\n\n${reviewBody}`;
312+ }
313+
286314 await github.rest.pulls.createReview({
287315 owner: context.repo.owner,
288316 repo: context.repo.repo,
289317 pull_number: prNumber,
290318 commit_id: commitSha,
291- body: `${reviewData.review_summary || 'AI Code Review'}\n\n---\n*💡 To request a new detailed review, comment \`@continue-detailed-review\`*`,
319+ body: reviewBody,
292320 event: 'COMMENT',
293321 comments: comments
294322 });
@@ -310,22 +338,19 @@
310338 }
311339 } else {
312340 // No inline comments, just post the summary
341+ let summaryBody = `## AI Code Review\n\n${reviewData.review_summary}\n\n*No specific line comments generated.*\n\n` +
342+ `---\n*💡 To request a new detailed review, comment \`@continue-detailed-review\`*`;
343+
344+ // Add triggered by note if from comment
345+ if (context.eventName === 'issue_comment') {
346+ summaryBody = `*Triggered by @${context.payload.comment.user.login}'s request*\n\n${summaryBody}`;
347+ }
348+
313349 await github.rest.issues.createComment({
314350 issue_number: prNumber,
315351 owner: context.repo.owner,
316352 repo: context.repo.repo,
317- body: `## AI Code Review\n\n${reviewData.review_summary}\n\n*No specific line comments generated.*\n\n` +
318- `---\n*💡 To request a new detailed review, comment \`@continue-detailed-review\`*`
319- });
320- }
321-
322- // Add triggered by note if from comment
323- if (context.eventName === 'issue_comment') {
324- await github.rest.issues.createComment({
325- issue_number: prNumber,
326- owner: context.repo.owner,
327- repo: context.repo.repo,
328- body: `*Inline review triggered by @${context.payload.comment.user.login}*`
353+ body: summaryBody
329354 });
330355 }
331356
modified actions/general-review/action.yml +10 −5
@@ -29,12 +29,17 @@
2929 SHOULD_RUN="false"
3030
3131 if [ "${{ github.event_name }}" = "pull_request" ]; then
32- # Check PR author association
33- AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}"
34- if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then
35- SHOULD_RUN="true"
32+ # Check if PR is a draft
33+ if [ "${{ github.event.pull_request.draft }}" = "true" ]; then
34+ echo "::notice::Skipping review - PR is a draft"
3635 else
37- echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)"
36+ # Check PR author association
37+ AUTHOR_ASSOC="${{ github.event.pull_request.author_association }}"
38+ if [ "$AUTHOR_ASSOC" = "OWNER" ] || [ "$AUTHOR_ASSOC" = "MEMBER" ] || [ "$AUTHOR_ASSOC" = "COLLABORATOR" ]; then
39+ SHOULD_RUN="true"
40+ else
41+ echo "::notice::Skipping review - PR author is not a team member (association: $AUTHOR_ASSOC)"
42+ fi
3843 fi
3944 elif [ "${{ github.event_name }}" = "issue_comment" ]; then
4045 # Check if it's a PR comment with the trigger phrase