step type "slack/status" is not a valid type

433 Views Asked by At

I am trying to integrate slack with circle ci only for specific jobs and following this documentation : https://circleci.com/orbs/registry/orb/circleci/slack. I am getting this error step type "slack/status" is not a valid type every time that job is run. Any help/feedback is appreciated, This is what I have done so far:

   version: 2
   orbs:
     slack: circleci/[email protected]
   
  jobs:

    slack_notification:
      docker:
        - image: circleci/node
      steps:
        - run: exit 0
        - slack/status:
            fail_only: false
            channel: {Channel ID}
            failure_message: ':red_circle: A $CIRCLE_JOB job has failed!'
            success_message: ':tada: A $CIRCLE_JOB job has succeeded!'
            include_project_field: true
            include_job_number_field: true
            url: 'https://circleci.com/workflow-run/${CIRCLE_WORKFLOW_ID}' 
            webhook: {webhook}

   workflows:
     version: 2
     jobs:
       - job_1:
         { Job steps}

       - slack_notification:
           requires:
             - {job_1}
           filters:
             branches:
              only:
                - {branch}
1

There are 1 best solutions below

1
On

use version: 2.1 instead workflow version 2 is fine