From 961c890ab5ed59ac6bad97c9ead30ab66bcd86fb Mon Sep 17 00:00:00 2001 From: Cam <21029087+cxmeel@users.noreply.github.com> Date: Thu, 14 Mar 2024 20:14:01 +0000 Subject: [PATCH] Refactor version check in pull-request.yml --- .github/workflows/pull-request.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2cc9b25..9262e5b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -34,16 +34,15 @@ jobs: - name: Ensure version parity run: lune run ensure-version-parity - - name: Fetch version from package.json - id: current-version - run: echo "current-version=$(jq -r .version package.json)" >> $GITHUB_ENV - - - name: Get previous release version - id: previous-version - run: echo "previous-version=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV - - name: Ensure version has changed - run: ${{ steps.current-version.outputs.current-version != steps.previous-version.outputs.previous-version }} + run: | + current_version=$(jq -r .version package.json) + previous_version=$(git show origin/main:package.json | jq -r .version) + + if [ "$current_version" == "$previous_version" ]; then + echo "Version has not changed" + exit 1 + fi - name: Ensure tests exist run: lune run ensure-tests src