first commit

This commit is contained in:
Tomáš Dvořák
2025-10-02 12:39:28 +02:00
commit 0fc92f8464
60 changed files with 11834 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
---
name: Bug report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---
## 🐛 Bug Description
A clear and concise description of what the bug is.
## 📋 To Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '...'
3. Scroll down to '...'
4. See error
## ✅ Expected Behavior
A clear and concise description of what you expected to happen.
## 📸 Screenshots
If applicable, add screenshots to help explain your problem.
## 💻 Environment
**Backend:**
- OS: [e.g., Ubuntu 22.04, Windows 11]
- Go Version: [e.g., 1.21]
- Deployment: [e.g., Docker, local]
**Frontend:**
- Browser: [e.g., Chrome 120, Firefox 121]
- OS: [e.g., Windows 11, macOS 14]
- Node Version: [e.g., 18.0]
**Docker (if applicable):**
- Docker Version: [e.g., 24.0.6]
- Docker Compose Version: [e.g., 2.21.0]
## 📝 Additional Context
Add any other context about the problem here.
## 🔍 Logs
```
Paste relevant logs here
```
## ✔️ Checklist
- [ ] I have searched existing issues
- [ ] I have included all relevant information
- [ ] I can reproduce this bug consistently
- [ ] I have tested with the latest version
+43
View File
@@ -0,0 +1,43 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: enhancement
assignees: ''
---
## 💡 Feature Description
A clear and concise description of the feature you'd like to see.
## 🤔 Problem Statement
Is your feature request related to a problem? Please describe.
Example: I'm always frustrated when [...]
## ✨ Proposed Solution
Describe the solution you'd like to see implemented.
## 🔄 Alternatives Considered
Describe any alternative solutions or features you've considered.
## 📊 Use Case
Describe how this feature would be used and who would benefit from it.
## 🎨 Mockups/Examples
If applicable, add mockups, screenshots, or examples.
## 📝 Additional Context
Add any other context or screenshots about the feature request here.
## ✔️ Checklist
- [ ] I have searched existing feature requests
- [ ] This feature aligns with the project's vision
- [ ] I have described the use case clearly
- [ ] I would be willing to contribute to this feature
@@ -0,0 +1,39 @@
# Logo Upload
## Club Information
**Club Name:** <!-- Required: e.g., AC Sparta Praha -->
**Club ID:** <!-- Required: UUID from FAČR API -->
**Club City:** <!-- Optional: e.g., Praha -->
**Club Type:** <!-- Optional: football or futsal -->
**Club Website:** <!-- Optional: e.g., https://www.sparta.cz -->
## File Information
**File Format:** <!-- SVG or PNG -->
**File Size:** <!-- e.g., 45 KB -->
**Has Transparent Background:** <!-- Yes/No -->
## Checklist
- [ ] Club Name is provided (required)
- [ ] Club ID is a valid UUID (required)
- [ ] File is in SVG or PNG format
- [ ] Logo has transparent background
- [ ] Logo is high quality
- [ ] Filename matches Club ID (UUID.svg or UUID.png)
- [ ] I have rights to upload this logo
## Additional Notes
<!-- Any additional context about this logo upload -->
---
**Note:** Uploads without Club Name or valid Club ID will be automatically rejected by GitHub Actions.
+65
View File
@@ -0,0 +1,65 @@
# Pull Request
## 📝 Description
Please include a summary of the changes and the related issue.
Fixes # (issue)
## 🔧 Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] 📚 Documentation update
- [ ] 🎨 Style update (formatting, renaming)
- [ ] ♻️ Code refactoring
- [ ] ⚡ Performance improvement
- [ ] ✅ Test update
## 🧪 Testing
Please describe the tests that you ran to verify your changes.
- [ ] Tested locally with Docker
- [ ] Tested locally without Docker
- [ ] Added new tests
- [ ] All existing tests pass
- [ ] Manual testing completed
**Test Configuration:**
- OS: [e.g., Windows 11]
- Go Version: [e.g., 1.21]
- Node Version: [e.g., 18.0]
## 📸 Screenshots (if applicable)
Add screenshots to demonstrate the changes.
## ✔️ Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published
## 📚 Documentation
- [ ] README updated (if needed)
- [ ] API_EXAMPLES updated (if needed)
- [ ] CHANGELOG updated
- [ ] Inline code comments added
## 🔗 Related Issues/PRs
Link any related issues or pull requests here.
## 💬 Additional Notes
Add any additional notes or context about the PR here.
+144
View File
@@ -0,0 +1,144 @@
name: Validate Logo Upload
on:
pull_request:
paths:
- 'logos/**'
- 'data/logos/**'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
logos/**
data/logos/**
- name: Validate logo files
run: |
echo "🔍 Validating logo uploads..."
# Check if any files were changed
if [ -z "${{ steps.changed-files.outputs.all_changed_files }}" ]; then
echo "No logo files changed"
exit 0
fi
HAS_ERROR=0
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "Checking: $file"
# Get filename without extension
filename=$(basename "$file")
filename_no_ext="${filename%.*}"
# Check if filename is a valid UUID
if ! echo "$filename_no_ext" | grep -qE '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$'; then
echo "❌ ERROR: $file - Filename must be a valid UUID"
HAS_ERROR=1
continue
fi
# Check file extension
extension="${filename##*.}"
if [ "$extension" != "svg" ] && [ "$extension" != "png" ]; then
echo "❌ ERROR: $file - Only .svg and .png files are allowed"
HAS_ERROR=1
continue
fi
# Check if file exists
if [ ! -f "$file" ]; then
echo "❌ ERROR: $file - File not found"
HAS_ERROR=1
continue
fi
echo "✅ PASS: $file"
done
if [ $HAS_ERROR -eq 1 ]; then
echo ""
echo "❌ Validation failed. Please fix the errors above."
exit 1
fi
echo ""
echo "✅ All logo files validated successfully!"
- name: Check PR description for club info
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
const body = pr.body || '';
console.log('🔍 Checking PR description for required information...');
// Check for club name
const hasClubName = /club[_\s-]?name\s*:?\s*(.+)/i.test(body);
const hasClubId = /club[_\s-]?id\s*:?\s*([0-9a-f-]+)/i.test(body);
if (!hasClubName) {
core.setFailed('❌ PR description must include "Club Name: <name>"');
return;
}
if (!hasClubId) {
core.setFailed('❌ PR description must include "Club ID: <uuid>"');
return;
}
// Extract values
const clubNameMatch = body.match(/club[_\s-]?name\s*:?\s*(.+)/i);
const clubIdMatch = body.match(/club[_\s-]?id\s*:?\s*([0-9a-f-]+)/i);
const clubName = clubNameMatch ? clubNameMatch[1].trim() : null;
const clubId = clubIdMatch ? clubIdMatch[1].trim() : null;
console.log(`✅ Club Name: ${clubName}`);
console.log(`✅ Club ID: ${clubId}`);
// Validate UUID format
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
if (!uuidRegex.test(clubId)) {
core.setFailed(`❌ Invalid Club ID format: ${clubId}`);
return;
}
console.log('✅ PR description validation passed!');
- name: Comment on PR
if: success()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ Logo upload validation passed!\n\n- File format: Valid\n- UUID format: Valid\n- Club information: Present\n\nReady for review and merge.'
})
- name: Reject on failure
if: failure()
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ Logo upload validation failed!\n\nPlease ensure:\n1. Filename is a valid UUID\n2. File format is .svg or .png\n3. PR description includes:\n - Club Name: <name>\n - Club ID: <uuid>\n\nSee the action logs for details.'
})