-
Notifications
You must be signed in to change notification settings - Fork 22
55 lines (49 loc) · 1.88 KB
/
plugin-version-check.yml
File metadata and controls
55 lines (49 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Plugin Version Check
on:
pull_request:
paths:
- 'hooks/plugin-claude/**'
jobs:
check-version-bump:
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get plugin.json version from PR
id: pr-version
run: |
PR_VERSION=$(jq -r '.version' hooks/plugin-claude/.claude-plugin/plugin.json)
echo "version=$PR_VERSION" >> $GITHUB_OUTPUT
echo "PR version: $PR_VERSION"
- name: Get plugin.json version from base branch
id: base-version
run: |
git fetch origin ${{ github.base_ref }}
BASE_VERSION=$(git show origin/${{ github.base_ref }}:hooks/plugin-claude/.claude-plugin/plugin.json | jq -r '.version')
echo "version=$BASE_VERSION" >> $GITHUB_OUTPUT
echo "Base version: $BASE_VERSION"
- name: Compare versions
env:
PR_VERSION: ${{ steps.pr-version.outputs.version }}
BASE_VERSION: ${{ steps.base-version.outputs.version }}
run: |
if [ "$PR_VERSION" == "$BASE_VERSION" ]; then
echo "❌ Error: plugin.json version has not been updated"
echo "Current version: $BASE_VERSION"
echo "Please bump the version in hooks/plugin-claude/.claude-plugin/plugin.json"
exit 1
else
echo "✅ Version has been updated: $BASE_VERSION -> $PR_VERSION"
fi
- name: Validate version format
env:
VERSION: ${{ steps.pr-version.outputs.version }}
run: |
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "❌ Error: Invalid version format: $VERSION"
echo "Version must follow semantic versioning (e.g., 0.0.3)"
exit 1
fi
echo "✅ Version format is valid: $VERSION"