Skip to content

Commit

Permalink
Bug/check-version (#58)
Browse files Browse the repository at this point in the history
* testing check version output

* yq output

* try -o

* fic check-version

* 2.9.9
  • Loading branch information
mattdean-digicatapult authored Mar 21, 2023
1 parent 4c4ec48 commit 4618fa3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digicatapult/dscp-ipfs",
"version": "2.9.8",
"version": "2.9.9",
"description": "Service for DSCP",
"main": "app/index.js",
"type": "module",
Expand Down
6 changes: 3 additions & 3 deletions scripts/check-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
set -e

function check_versions_consistent () {
local PACKAGE_VERSION=$(yq eval '.version' ./package.json)
local PACKAGE_LOCK_VERSION=$(yq eval '.version' ./package-lock.json)
local PACKAGE_VERSION=$(yq eval -o y '.version' ./package.json)
local PACKAGE_LOCK_VERSION=$(yq eval -o y '.version' ./package-lock.json)

if [ "$PACKAGE_VERSION" != "$PACKAGE_LOCK_VERSION" ]; then
echo "Inconsistent versions detected"
Expand Down Expand Up @@ -40,7 +40,7 @@ function check_version_greater () {
# Get published git tags that match semver regex with a "v" prefix then remove the "v" character
PUBLISHED_VERSIONS=$(git tag | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+\(\-[a-zA-Z-]\+\(\.[0-9]\+\)*\)\{0,1\}$" | sed 's/^v\(.*\)$/\1/')
# Get the current version from package.json
CURRENT_VERSION=$(yq eval '.version' ./package.json)
CURRENT_VERSION=$(yq eval -o y '.version' ./package.json)

if check_version_greater "$CURRENT_VERSION" "$PUBLISHED_VERSIONS"; then
echo "VERSION=v$CURRENT_VERSION" >> $GITHUB_OUTPUT
Expand Down

0 comments on commit 4618fa3

Please sign in to comment.