-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check primer view components versions consistency on commit
So that I'll stop upgrading it in `Gemfile.lock` and not in `frontend/package.json`. See #17681
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
31 changes: 31 additions & 0 deletions
31
script/check_same_primer_view_components_version_everywhere
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
VERSION_REGEXP='\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?' | ||
|
||
echo "Checking for same primer view components version in Gemfile.lock and frontend/package.json" | ||
|
||
versions=$(grep --color=never primer.view.components frontend/package.json Gemfile.lock \ | ||
| grep --extended-regexp --only-matching "$VERSION_REGEXP" \ | ||
| sort --unique --version-sort) | ||
|
||
if [ -z "$versions" ] | ||
then | ||
echo "Skipping check. Unable to detect Primer view components version." | ||
exit | ||
fi | ||
|
||
version_count=$(echo "$versions" | wc -l) | ||
if [ $version_count -eq 1 ] | ||
then | ||
echo "Ok. Primer view components version is $versions everywhere" | ||
exit | ||
fi | ||
|
||
grep --color=never primer.view.components frontend/package.json Gemfile.lock \ | ||
| grep --color=always --extended-regexp "$VERSION_REGEXP" | ||
|
||
echo "Error. Different Primer view components versions are used ($(echo $versions))" | ||
echo "Please use only one version in both Gemfile.lock and frontend/package.json" | ||
exit 1 |