Skip to content

Conversation

@SpiGAndromeda
Copy link
Contributor

What

Adds a GitHub Actions workflow that validates PRs against contribution guidelines using Gemini AI and provides actionable feedback.

Why

Manual review of contribution standards is inconsistent and time-consuming. This validator ensures consistent quality across all contributions while providing immediate feedback.

Live Demonstrations

See the validator in action:

Key Features

  • Validates all contributions using Gemini AI
  • Updates existing comments with timestamps
  • Security-first design with minimal permissions
  • Abuse prevention via PR size limits
  • Graceful degradation if API unavailable
  • Cost-effective: ~1,500 tokens per PR

Configuration

  1. Set GEMINI_API_KEY secret in repository settings
  2. Optionally add to branch protection as required check

Technical Details

  • Permissions: contents:read, pull-requests:write, statuses:write
  • Triggers: PR opened, synchronized, edited
  • Rate limits: 60 requests/min by Gemini API
  • Abuse prevention: Skips PRs with additions > 10k, files > 100, commits > 50

Validates PRs against contribution guidelines using Gemini AI to ensure
consistent quality and reduce manual review burden. Provides actionable
feedback to contributors on commit messages, PR titles, and descriptions.

Updates existing comments instead of creating duplicates for clean PR interface.
Includes timestamps showing when validation last ran. Implements abuse prevention
via PR size limits and graceful degradation if API unavailable.

Features:
- Validates all contributions using Gemini AI
- Updates comments instead of creating duplicates
- Abuse prevention: PR limits (additions < 10k, files < 100, commits < 50)
- Minimal permissions: contents:read, pull-requests:write, statuses:write
- Token budget: ~1,500 per PR, supports ~1,300 PRs/month on free tier
- Uses safe 'pull_request' trigger for security
@SpiGAndromeda
Copy link
Contributor Author

You can get an API Key for the project by opening going to https://aistudio.google.com/app/apikey and create one there. The limits are more than suffienct for this purpose.

@nizos
Copy link
Owner

nizos commented Aug 17, 2025

Hi @SpiGAndromeda,

Thank you for this thoughtful contribution!

For where TDD Guard currently stands, this feels a bit premature. Our contribution volume is still manageable with manual review, and I'd prefer to avoid the added complexity and maintenance burden of external dependencies at this stage. The CONTRIBUTING.md guidelines you've created are excellent and more than sufficient for our current needs.

I'm closing this for now, but please don't let this discourage you! If you're interested in contributing more, I'd especially welcome help with support for more languages and test frameworks.

Thanks again for taking the time to improve our workflow!

@nizos nizos closed this Aug 17, 2025
@SpiGAndromeda
Copy link
Contributor Author

I appreciate the honest response and it's totally fine. It was fun to implement it and I will create a GH action from it.

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.

2 participants