diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index d605527..0d7ba95 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -12,6 +12,25 @@ jobs: steps: - checkout - nx/set-shas + - run: + name: Check values + shell: "/bin/bash" + command: | + HEAD_SHA=$(git rev-parse HEAD) + if [[ -z "$CIRCLE_PULL_REQUEST" ]]; then + BASE_SHA=$(git merge-base origin/main HEAD) + else + BASE_SHA=$(git rev-parse origin/main~1) + fi + echo "Comparing head: $NX_HEAD to $HEAD_SHA" + echo "Comparing base: $NX_BASE to $BASE_SHA" + if [[ $NX_HEAD == $HEAD_SHA && $NX_BASE == $BASE_SHA ]]; then + echo "Test conditions met" + else + echo "Exiting Job" + circleci-agent step halt + fi + workflows: test-deploy: jobs: