We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba1fdac commit 3c66893Copy full SHA for 3c66893
.github/actions/set-version/action.yml
@@ -15,5 +15,18 @@ runs:
15
fi
16
# Strip leading 'v' if present
17
VERSION="${BRANCH_NAME#v}"
18
+
19
+ # Get version from package.json
20
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
21
22
+ # Verify versions match
23
+ if [ "$VERSION" != "$PACKAGE_VERSION" ]; then
24
+ echo "Error: Version mismatch!"
25
+ echo " Branch version: $VERSION"
26
+ echo " package.json version: $PACKAGE_VERSION"
27
+ echo "Please ensure the branch name matches the version in package.json"
28
+ exit 1
29
+ fi
30
31
echo "VERSION=$VERSION" >> $GITHUB_ENV
32
echo "Using version: $VERSION (from branch: $BRANCH_NAME)"
0 commit comments