Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Fixing check-version script
Browse files Browse the repository at this point in the history
  • Loading branch information
dblane-digicatapult authored and mattdean-digicatapult committed Aug 1, 2023
1 parent 7b370ac commit 05161ef
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/wasp-ingest-http",
"version": "1.1.0",
"version": "1.1.1",
"description": "Service for WASP",
"main": "app/index.js",
"scripts": {
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 05161ef

Please sign in to comment.