GeezerVison is showing github.com — ci: prevent duplicate PR check from flagging current PR as duplicate … · prashanthpai/opencode@c6a241e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/duplicate-prs.yml +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
44 | 44 | { |
45 | 45 | echo "Check for duplicate PRs related to this new PR:" |
46 | 46 | echo "" |
| 47 | + echo "CURRENT_PR_NUMBER: $PR_NUMBER" |
| 48 | + echo "" |
47 | 49 | echo "Title: $(gh pr view "$PR_NUMBER" --json title --jq .title)" |
48 | 50 | echo "" |
49 | 51 | echo "Description:" |
|
Collapse file
Copy file name to clipboardExpand all lines: .opencode/agent/duplicate-pr.md +2Lines changed: 2 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -12,6 +12,8 @@ You are a duplicate PR detection agent. When a PR is opened, your job is to sear |
12 | 12 |
|
13 | 13 | Use the github-pr-search tool to search for PRs that might be addressing the same issue or feature. |
14 | 14 |
|
| 15 | +IMPORTANT: The input will contain a line `CURRENT_PR_NUMBER: NNNN`. This is the current PR number, you should not mark that the current PR as a duplicate of itself. |
| 16 | + |
15 | 17 | Search using keywords from the PR title and description. Try multiple searches with different relevant terms. |
16 | 18 |
|
17 | 19 | If you find potential duplicates: |
|
Collapse file
Copy file name to clipboardExpand all lines: .opencode/tool/github-pr-search.ts +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -45,6 +45,11 @@ export default tool({ |
45 | 45 | } |
46 | 46 |
|
47 | 47 | const prs = result.items as PR[] |
| 48 | + |
| 49 | + if (prs.length === 0) { |
| 50 | + return `No other PRs found matching "${args.query}"` |
| 51 | + } |
| 52 | + |
48 | 53 | const formatted = prs.map((pr) => `${pr.title}\n${pr.html_url}`).join("\n\n") |
49 | 54 |
|
50 | 55 | return `Found ${result.total_count} PRs (showing ${prs.length}):\n\n${formatted}` |
|