This repository was archived by the owner on Aug 25, 2026. It is now read-only.
Merge pull request #2 from clzmj/auto-release-workflow #6
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: Version Validation | |
| on: | |
| pull_request: | |
| paths: | |
| - 'plugins/**' | |
| - '.claude-plugin/marketplace.json' | |
| push: | |
| branches: [main] | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| validate-versions: | |
| runs-on: self-hosted | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Full history for git diff | |
| - name: Validate version consistency | |
| run: | | |
| echo "🔍 Checking version consistency..." | |
| # Discover every plugin on disk — no hardcoded list to maintain. | |
| shopt -s nullglob | |
| found=0 | |
| for plugin_json in plugins/*/.claude-plugin/plugin.json; do | |
| found=1 | |
| plugin=$(jq -r '.name' "$plugin_json") | |
| plugin_version=$(jq -r '.version' "$plugin_json") | |
| marketplace_version=$(jq -r ".plugins[] | select(.name==\"$plugin\") | .version" .claude-plugin/marketplace.json) | |
| echo " $plugin:" | |
| echo " plugin.json: $plugin_version" | |
| echo " marketplace.json: $marketplace_version" | |
| if [ "$plugin_version" != "$marketplace_version" ]; then | |
| echo "❌ Version mismatch for $plugin (or missing from marketplace.json)!" | |
| exit 1 | |
| fi | |
| # Validate date-based version format (YYYY-MM-DD, optional .N same-day suffix) | |
| if ! [[ $plugin_version =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}(\.[0-9]+)?$ ]]; then | |
| echo "❌ Invalid date version for $plugin: $plugin_version" | |
| echo " Expected format: YYYY-MM-DD (e.g., 2026-06-17)" | |
| exit 1 | |
| fi | |
| echo " ✓ Versions match and valid" | |
| done | |
| if [ "$found" = 0 ]; then | |
| echo "❌ No plugins found under plugins/*/.claude-plugin/plugin.json" | |
| exit 1 | |
| fi | |
| - name: Summary | |
| run: | | |
| echo "" | |
| echo "✅ Version validation passed!" | |
| echo "" | |
| echo "📌 Versions must match between:" | |
| echo " - plugins/PLUGIN/.claude-plugin/plugin.json" | |
| echo " - .claude-plugin/marketplace.json" | |
| echo "" | |
| echo "ℹ️ Version bumps are handled by: .github/workflows/release.yml" | |
| echo " Trigger with: workflow_dispatch on GitHub Actions" |