Skip to content

Add GitHub Actions workflow to detect duplicate tools using AI inference#6

Merged
pelikhan merged 29 commits into
mainfrom
copilot/fix-5
Jun 26, 2025
Merged

Add GitHub Actions workflow to detect duplicate tools using AI inference#6
pelikhan merged 29 commits into
mainfrom
copilot/fix-5

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 19, 2025

This PR implements a GitHub Actions workflow that automatically detects duplicate tool entries in the README.md file using the actions/ai-inference action.

Features

The workflow (detect-duplicate-tools.yml) provides:

  • Automatic triggering: Runs on push and pull request events when README.md is modified
  • AI-powered analysis: Uses actions/ai-inference with the gpt-4o-mini model to intelligently detect duplicates
  • Comprehensive detection: Identifies duplicates based on:
    • Exact GitHub repository URL matches
    • Similar tool names (case-insensitive, ignoring punctuation)
    • Same products listed in different sections
  • Detailed reporting: Provides section locations, matching criteria, and consolidation recommendations

Example Detection

The workflow will detect existing duplicates in the current README.md, such as:

  • Shippie appears in both "Continuous Code Review" and "Programming Frameworks → Markdown" sections with the same GitHub URL (https://github.com/mattzcarey/shippie)

Implementation Details

  • Follows repository conventions (permissions, concurrency control, uses actions/checkout@v4)
  • Clean YAML formatting with proper line length and no trailing spaces
  • Minimal permissions required: contents: read, issues: write, pull-requests: write, models: read
  • Uses the same patterns as existing workflows in the repository

Fixes #5.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 3 commits June 19, 2025 01:36
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Detect duplicate tools Add GitHub Actions workflow to detect duplicate tools using AI inference Jun 19, 2025
Copilot AI requested a review from pelikhan June 19, 2025 01:39
@pelikhan
Copy link
Copy Markdown
Contributor

@copilot fix the code

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 19, 2025

@copilot fix the code

Fixed the workflow and README issues. The main problems were:

  1. Used non-existent actions/ai-inference@v1 action - replaced with working GitHub Models API approach using actions/github-script
  2. Removed test comment from README.md
  3. Fixed malformed URL in GenAIScript entry (had double https://)

The workflow now follows the same pattern as the Home Assistant example referenced in the repository. Commit: 6f72515

@pelikhan
Copy link
Copy Markdown
Contributor

@copilot

Revert your last fixed. the input field is token, not github-token. Look at the github action failure.

…nference

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 19, 2025

@copilot

Revert your last fixed. the input field is token, not github-token. Look at the github action failure.
...

Fixed the parameter name from github-token to token and reverted back to using actions/ai-inference@v1 as requested. Commit: 0d1cea1

they serve different purposes

If no duplicates are found, simply respond with "No duplicate
tools detected." No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot read and append the content of readme as a user message in this request

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified the workflow to read the README.md content and append it as part of the user message in the AI inference request. The workflow now reads the file content into a GitHub output variable and includes it directly in the prompt. Commit: 2dc00d5

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan June 19, 2025 04:02
@pelikhan
Copy link
Copy Markdown
Contributor

needs better prompting

…output format

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 19, 2025

needs better prompting

Improved the prompting with better structure and reliability. The key changes include:

• Fixed grammatical errors ("Duplicates found" not "Duplicate founds")
• Implemented structured output format with clear SUCCESS/NO_DUPLICATES states
• Added role-based prompting and specific examples
• Simplified conditional logic and enhanced response format specification

This should provide much more consistent and actionable output from the AI model. Commit: ec730e0

@pelikhan
Copy link
Copy Markdown
Contributor

Update the prompt to Ignore the duplicates in the programming framework sections

…plicates

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 19, 2025

Update the prompt to Ignore the duplicates in the programming framework sections

Updated the prompt to ignore duplicates in Programming Frameworks sections. The workflow now explicitly excludes tools that appear in both main sections and Programming Frameworks subsections from being flagged as duplicates. Commit: 86759ce

@pelikhan
Copy link
Copy Markdown
Contributor

The AI likes to wrap the entire response in a ```markdown code section. Maybe sure it doesn'to do this.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 19, 2025

The AI likes to wrap the entire response in a ```markdown code section. Maybe sure it doesn'to do this.

Fixed the prompting to prevent AI from wrapping responses in markdown code blocks. Added explicit instruction "Do NOT wrap your response in markdown code blocks" and removed all code block examples from the prompt format. Commit: 57ec352

Copilot AI requested a review from pelikhan June 19, 2025 13:08
@pelikhan pelikhan marked this pull request as ready for review June 26, 2025 13:22
@pelikhan pelikhan merged commit a808d9d into main Jun 26, 2025
1 check passed
@pelikhan pelikhan deleted the copilot/fix-5 branch June 26, 2025 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect duplicate tools

3 participants