Skip to content

Commit a808d9d

Browse files
authored
Merge pull request #6 from githubnext/copilot/fix-5
Add GitHub Actions workflow to detect duplicate tools using AI inference
2 parents 40e9815 + 57ec352 commit a808d9d

2 files changed

Lines changed: 103 additions & 1 deletion

File tree

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Detect Duplicate Tools
2+
on:
3+
workflow_dispatch:
4+
push:
5+
paths:
6+
- 'README.md'
7+
pull_request:
8+
paths:
9+
- 'README.md'
10+
permissions:
11+
contents: read
12+
issues: write
13+
pull-requests: write
14+
models: read
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
jobs:
19+
detect-duplicates:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/ai-inference@main
24+
id: detect-duplicates
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
model: openai/gpt-4o
28+
max-tokens: 14000
29+
prompt-file: 'README.md'
30+
system-prompt: |
31+
You are an expert code reviewer analyzing a README.md file for
32+
duplicate tool entries.
33+
34+
## Task
35+
Analyze the provided README.md content and detect duplicate tool
36+
entries based on these criteria:
37+
38+
**Duplicate Criteria:**
39+
1. **Exact URL matches** - Same GitHub repository URL
40+
2. **Similar tool names** - Case-insensitive, ignoring
41+
punctuation/spacing
42+
3. **Same product in different sections** - Identical tools listed
43+
multiple times
44+
45+
**IMPORTANT: Ignore duplicates in Programming Frameworks sections**
46+
- Do NOT flag as duplicates if one instance is under "Programming Frameworks" section
47+
- Tools can legitimately appear in both main sections AND programming framework subsections
48+
- Programming Frameworks subsections include: YAML, Shell Scripting, JavaScript/TypeScript, Markdown, etc.
49+
50+
**Format to analyze:**
51+
- Focus on bulleted lists under section headings
52+
- Each entry follows: `* [Tool Name](URL) - description`
53+
- Only flag duplicates between main sections (excluding Programming Frameworks)
54+
55+
## Output Format
56+
57+
**IMPORTANT: Respond in plain text format only. Do NOT wrap your response in markdown code blocks.**
58+
59+
**If duplicates found, respond exactly in this format:**
60+
61+
DUPLICATES_FOUND
62+
63+
## Duplicate Analysis
64+
65+
### Duplicate 1: [Tool Name]
66+
**Sections:** Section A, Section B
67+
**URLs:**
68+
- [Link 1](url1)
69+
- [Link 2](url2)
70+
**Issue:** [Exact match/Similar name/Same product]
71+
**Recommendation:** [Consolidate/Clarify differences/Keep separate
72+
with different descriptions]
73+
74+
### Duplicate 2: [Tool Name]
75+
[Same format]
76+
77+
## Code Snippets
78+
[Relevant README snippets showing the duplicates]
79+
80+
**If no duplicates found, respond exactly:**
81+
82+
NO_DUPLICATES_FOUND
83+
84+
## Example Duplicates to Look For
85+
- Tools appearing in multiple main sections (excluding Programming Frameworks)
86+
- Multiple entries with identical GitHub URLs (excluding Programming Frameworks)
87+
- Similar names like "GenAI Tool" vs "GenAI-Tool" vs "genai tool" (excluding Programming Frameworks)
88+
89+
**Examples of what NOT to flag:**
90+
- A tool in "Continuous Code Review" and also in "Programming Frameworks → Markdown"
91+
- A tool in "Continuous Triage" and also in "Programming Frameworks → JavaScript/TypeScript"
92+
93+
Analyze this README.md content:
94+
- name: If duplicates create issue
95+
if: >-
96+
contains(steps.detect-duplicates.outputs.response, 'DUPLICATES_FOUND')
97+
run: |
98+
gh issue create --title "Duplicate Tools Detected" \
99+
--body-file ${{ steps.detect-duplicates.outputs.response-file }} \
100+
--label "genai,documentation"
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Some of them have builtin support for GitHub Actions and/or GitHub Models.
9292

9393
### JavaScript/TypeScript
9494

95-
* [GenAIScript](https://https://microsoft.github.io/genaiscript/), a scripting language for GitHub Actions that simplifies the use of AI models and tools in workflows
95+
* [GenAIScript](https://microsoft.github.io/genaiscript/), a scripting language for GitHub Actions that simplifies the use of AI models and tools in workflows
9696

9797
### Markdown
9898

0 commit comments

Comments
 (0)