Error calling command slack

slack
#1

I’m using a version 2.1 config file. I’ve imported the slack orbs into my config. I’ve enabled pipelines in my project settings. But I get an error like:

#!/bin/sh -eo pipefail
# Error calling workflow: 'default'
# Error calling job: 'deploy'
# Error calling command: 'slack/status'
# Type error for argument include_project_field: expected type: boolean, actual value: \"true\" (type string)
# Type error for argument include_visit_job_action: expected type: boolean, actual value: \"true\" (type string)
# Type error for argument include_job_number_field: expected type: boolean, actual value: \"true\" (type string)
# 
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false

Here’s what the config file looks like:

# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1

orbs:
  slack: circleci/slack@2.2.0

defaults: &defaults
  docker:
    - image: circleci/node:8.10

jobs:

  build:
    <<: *defaults

    steps:
      - checkout
      - run: npm install
      - persist_to_workspace:
          root: ../
          paths: ./*

  test:
    <<: *defaults
    steps:
      - attach_workspace:
          at: ~/
      # run tests!
      - run: npm test
      - run: npm run report-cov

  deploy:
    <<: *defaults
    steps:
      - run: exit 0
      - slack/status:
          include_project_field: "true"
          include_job_number_field: "true"
          include_visit_job_action: "true"

workflows:
  version: 2
  default:
    jobs:
      - build:
          context: ci-read
          filters:
            tags:
              only: /.*/
      - test:
          requires: [build]
          filters:
            tags:
              only: /.*/
      - deploy:
          context: ci-write
          requires: [test]
#2

Hi @benyamin-noori can you open an issue against the GitHub repo for the orb?

Thanks!

#3

Oh just kidding, I can resolve this right here @benyamin-noori

# Type error for argument include_project_field: expected type: boolean, actual value: \"true\" (type string)
# Type error for argument include_visit_job_action: expected type: boolean, actual value: \"true\" (type string)
# Type error for argument include_job_number_field: expected type: boolean, actual value: \"true\" (type string)

It wants boolean values but you’re passing it string values. Remove your "s around true.

Also, you don’t need to pass true to those parameters, as the default values are already true.

Thanks!

1 Like
closed #4

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.