Hi everyone,
Basically I’m trying to use circleci step halt to stop a workflow at a given point, but I don’t see it doing anything or even erroring out, maybe I’m not using it correctly or it is not supported in 2.1? Is there any alternative way of accomplishing something like this without failing the job?
This is the config I’m testing with:
version: 2.1
orbs:
  hello: circleci/hello-build@0.0.5
  build-tools: circleci/build-tools@2.6.3
jobs:
  build:
    docker:
      - image: circleci/node:12
    steps:
      - checkout
      - setup_remote_docker
      - build-tools/install-ci-tools
      - run: |
            if [[ $(echo "$CIRCLE_PULL_REQUEST $CIRCLE_PULL_REQUESTS" | grep -c "pull") -gt 0 ]]; then
              echo "a PR staph!"
              circleci step halt
              circleci-agent step halt
              exit 0
            else
              echo "not a PR"
            fi
workflows:
  "Hello Workflow":
    jobs:
      - hello/hello-build:
          requires:
            - build
          filters:
            branches:
              only:
                - testing
                - /^(?!pull\/).*$/
            tags:
              only:
                - /^pull\/.*$/
      - build:
          filters:
            branches:
              only:
                - testing
                - /^(?!pull\/).*$/
            tags:
              only:
                - /^pull\/.*$/
Thanks.

