⚠️ EXPERIMENTAL PROJECT - Not for production use. Breaking changes expected.
AI-powered GitHub Action that validates PR text format compliance using Google Gemini.
name: Validate Contributions
on:
pull_request:
types: [opened, synchronize, edited]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shopware/ai-contribution-validation-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}
- Get API Key: Google AI Studio → Add as
GEMINI_API_KEY
secret - Add Guidelines: Create
CONTRIBUTING.md
with your standards - Add Workflow: Copy Quick Start to
.github/workflows/validate-pr.yml
Input | Description | Required | Default |
---|---|---|---|
github-token |
GitHub token for API access | ✅ | |
gemini-api-key |
Google Gemini API key | ✅ | |
guidelines-file |
Path to contribution guidelines | CONTRIBUTING.md |
|
gemini-model |
gemini-1.5-flash or gemini-1.5-pro |
gemini-1.5-flash |
|
max-pr-size |
Maximum PR size (lines) | 5000 |
|
fail-on-errors |
Fail on validation errors | false |
|
comment-identifier |
PR comment identifier | ai-validator |
|
skip-authors |
Comma-separated authors to skip | "" |
Outputs: validation-status
(PASS/FAIL/WARNINGS), validation-summary
(JSON), comment-url
Validates:
- Commit message format (e.g.,
type(scope): description
) - PR title structure and clarity
- PR description completeness
Not evaluated (future releases):
- Code quality, architecture, implementation details
skip-authors: 'dependabot[bot],renovate[bot],github-actions[bot]'
gemini-model: 'gemini-1.5-pro'
fail-on-errors: true
max-pr-size: 1000
if: github.event.pull_request.head.repo.fork == true
runs-on: ubuntu-latest
# ... with fail-on-errors: false
Status | Meaning | Action Required |
---|---|---|
✅ PASS | Meets all guidelines | None - ready to merge |
Minor suggestions | Optional improvements | |
❌ FAIL | Has issues | Must fix before merge |
## AI Validation Results
### Status: ❌ Needs Improvement
### Issues Found:
- Commit message doesn't follow conventional commits format
- PR description lacks test plan section
### Specific Improvements:
#### Suggested PR Title:
feat(auth): add OAuth2 integration with JWT support
#### Suggested Commit Message:
feat(auth): add OAuth2 integration
Implement OAuth2 authentication flow with JWT token generation. Closes #123
Issue | Solution |
---|---|
"Repository not found" | Add contents: read and pull-requests: write permissions |
"Gemini API Error" | Verify API key and quotas in Google AI Studio |
"PR Too Large" | Increase max-pr-size or split PR |
Rate limits | Built-in exponential backoff handles automatically |
Debug mode | Set ACTIONS_STEP_DEBUG: true environment variable |
Model | Cost per PR |
---|---|
Flash | $0.001-0.05 |
Pro | $0.01-0.50 |
- Development Guide - Contributing, testing, architecture
- Issues
- Discussions
MIT License - Made by Shopware