From af68f8b1fffa51f7eccca5f85fc5c557b38a1d0b Mon Sep 17 00:00:00 2001 From: Yeicor <4929005+Yeicor@users.noreply.github.com> Date: Sun, 10 Mar 2024 18:13:05 +0100 Subject: [PATCH] fix CI deployment 7 --- .github/workflows/deploy1.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy1.yml b/.github/workflows/deploy1.yml index 31b988b..93ce230 100644 --- a/.github/workflows/deploy1.yml +++ b/.github/workflows/deploy1.yml @@ -17,7 +17,14 @@ jobs: with: # Ensure we are not in a detached HEAD state ref: "master" # Check that the tag commit is the latest master commit - - run: "[[ $(git rev-parse ${{ github.ref }}) == $(git rev-parse master) ]] || exit 1" + - run: | + git fetch --tags + tag_commit=$(git rev-parse ${{ github.ref }}) + master_commit=$(git rev-parse master) + if [ "$tag_commit" != "$master_commit" ]; then + echo "The tag commit ($tag_commit) is not the latest master commit ($master_commit)" + exit 1 + fi - run: "echo 'CLEAN_VERSION=${{ github.ref }}' | sed 's,refs/tags/v,,g' >> $GITHUB_ENV" # Write the new version to package.json - uses: "actions/setup-node@v4"