Merge pull request #1 from jcmrs/copilot/create-smart-workflows #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate Plugin Manifests | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| paths: | |
| - '.claude-plugin/plugin.json' | |
| - '.claude-plugin/marketplace.json' | |
| - '.github/workflows/validate-manifests.yml' | |
| pull_request: | |
| branches: [ main, develop ] | |
| paths: | |
| - '.claude-plugin/plugin.json' | |
| - '.claude-plugin/marketplace.json' | |
| - '.github/workflows/validate-manifests.yml' | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.9' | |
| - name: Validate plugin.json exists and is valid JSON | |
| run: | | |
| if [ ! -f .claude-plugin/plugin.json ]; then | |
| echo "Error: .claude-plugin/plugin.json not found" | |
| exit 1 | |
| fi | |
| python -m json.tool .claude-plugin/plugin.json > /dev/null | |
| echo "✓ plugin.json is valid JSON" | |
| - name: Validate marketplace.json exists and is valid JSON | |
| run: | | |
| if [ ! -f .claude-plugin/marketplace.json ]; then | |
| echo "Error: .claude-plugin/marketplace.json not found" | |
| exit 1 | |
| fi | |
| python -m json.tool .claude-plugin/marketplace.json > /dev/null | |
| echo "✓ marketplace.json is valid JSON" | |
| - name: Check required fields in plugin.json | |
| run: | | |
| python3 << 'EOF' | |
| import json | |
| import sys | |
| required_fields = ['name', 'version', 'description', 'author', 'license'] | |
| with open('.claude-plugin/plugin.json', 'r') as f: | |
| data = json.load(f) | |
| missing = [field for field in required_fields if field not in data] | |
| if missing: | |
| print(f"Error: Missing required fields in plugin.json: {', '.join(missing)}") | |
| sys.exit(1) | |
| print("✓ All required fields present in plugin.json") | |
| EOF | |
| - name: Check required fields in marketplace.json | |
| run: | | |
| python3 << 'EOF' | |
| import json | |
| import sys | |
| required_fields = ['display_name', 'summary', 'description', 'categories', 'icon', 'publisher', 'license', 'version'] | |
| with open('.claude-plugin/marketplace.json', 'r') as f: | |
| data = json.load(f) | |
| missing = [field for field in required_fields if field not in data] | |
| if missing: | |
| print(f"Error: Missing required fields in marketplace.json: {', '.join(missing)}") | |
| sys.exit(1) | |
| print("✓ All required fields present in marketplace.json") | |
| EOF |