CircleCI-Public / slack-orb

Create custom Slack notifications for CircleCI job statuses
https://circleci.com/developer/orbs/orb/circleci/slack
MIT License
212 stars 205 forks source link

Parse Error when sending slack notification #425

Closed khaled5321 closed 9 months ago

khaled5321 commented 9 months ago

Orb version: 4.12.5

What happened:

When I try to send notifications I get this error:

Posting Status
BASH_ENV file: /tmp/.bash_env-6501b48eb4b50a2a616b6786-0-build
Exists. Sourcing into ENV
Checking For JQ + CURL
Nothing to sanitize.
parse error: Expected another key-value pair at line 9, column 9
parse error: Expected another key-value pair at line 9, column 9

Exited with code exit status 4

Here is my code:

test_notification:
    machine: true
    environment:
      SLACK_ACCESS_TOKEN: token
    steps:
      - slack/notify:
            custom: |
              {
                "blocks": [
                  {
                    "type": "section",
                    "fields": [
                      {
                        "type": "plain_text",
                        "text": "Test notification",
                      }
                    ]
                  }
                ]
              }
            event: always
            channel: channel name