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

Fixing check-version script #53

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-reading-service",
"version": "0.1.43",
"version": "0.1.44",
"description": "Service for WASP",
"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