Skip to content

Commit 581a238

Browse files
Add script to validate Biome version consistency.
1 parent d4b75a7 commit 581a238

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/check-biome-version.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Script to check if Biome version in package.json matches the version in .github/workflows/biome.yml
4+
5+
# Extract Biome version from package.json (removing the ^ if present)
6+
PACKAGE_VERSION=$(grep -o '"@biomejs/biome": "\^*[0-9.]*"' package.json | grep -o '[0-9.]*')
7+
8+
# Extract Biome version from .github/workflows/biome.yml
9+
WORKFLOW_VERSION=$(grep -o 'version: "[0-9.]*"' .github/workflows/biome.yml | grep -o '[0-9.]*')
10+
11+
echo "Biome version in package.json: $PACKAGE_VERSION"
12+
echo "Biome version in workflow file: $WORKFLOW_VERSION"
13+
14+
# Check if versions match
15+
if [ "$PACKAGE_VERSION" != "$WORKFLOW_VERSION" ]; then
16+
echo "Error: Biome versions do not match!"
17+
echo "Please update the version in .github/workflows/biome.yml to match the version in package.json."
18+
exit 1
19+
else
20+
echo "Biome versions match."
21+
fi

0 commit comments

Comments
 (0)