Rename rhivos-content plugin to rhivos-tools #341
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 versions | |
| on: | |
| pull_request: | |
| jobs: | |
| check-version-bump: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout PR | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Check version bumps for changed plugins | |
| run: | | |
| set -e | |
| # Discover the remote name (don't assume 'origin') | |
| remote=$(git remote | head -n1) | |
| # Fetch the base branch to ensure we have it | |
| git fetch "$remote" "${{ github.event.pull_request.base.ref }}" | |
| # Find the merge-base between PR head and base branch | |
| base=$(git merge-base "$remote/${{ github.event.pull_request.base.ref }}" HEAD) | |
| # Find plugins with changes (excluding README.md and SKILL.md description files) | |
| changed_plugins=$(git diff --name-only "$base" HEAD -- 'plugins/' | \ | |
| grep -v 'README.md$' | \ | |
| grep -v 'SKILL.md$' | \ | |
| cut -d'/' -f2 | sort -u) | |
| if [ -z "$changed_plugins" ]; then | |
| echo "No plugin code changes detected" | |
| exit 0 | |
| fi | |
| errors=0 | |
| for plugin in $changed_plugins; do | |
| plugin_json="plugins/$plugin/.claude-plugin/plugin.json" | |
| if [ ! -f "$plugin_json" ]; then | |
| echo "SKIP: $plugin - no plugin.json" | |
| continue | |
| fi | |
| # Get current version | |
| current=$(jq -r '.version' "$plugin_json") | |
| # Get base version | |
| if git show "$base:$plugin_json" > /tmp/old_plugin.json 2>/dev/null; then | |
| old=$(jq -r '.version' /tmp/old_plugin.json) | |
| else | |
| old="0.0.0" # New plugin | |
| fi | |
| if [ "$current" = "$old" ]; then | |
| echo "::error file=$plugin_json::Plugin '$plugin' has code changes but version not bumped ($old)" | |
| errors=$((errors + 1)) | |
| else | |
| echo "OK: $plugin version bumped $old -> $current" | |
| fi | |
| done | |
| if [ $errors -gt 0 ]; then | |
| echo "" | |
| echo "::error::$errors plugin(s) need version bumps. Update .claude-plugin/plugin.json for each." | |
| exit 1 | |
| fi |