Skip to content

The plugin sends notifications as successful. #162

@sviatoslav6

Description

@sviatoslav6

The plugin sends notifications as successful, even when some steps in the pipeline have failed and resulted in an error.

My pipeline

kind: pipeline
type: kubernetes
name: test

trigger:
  branch:
    - master

clone:
  disable: true

steps:
  - name: test
    image: bitnami/git
    environment:
      SLACK_WEBHOOK:
        from_secret: SLACK_WEBHOOK
    commands:
      - kubectl get pod
    when:
      event: [push]

  - name: slack-notify
    image: plugins/slack
    environment:
      SLACK_WEBHOOK:
        from_secret: SLACK_WEBHOOK
    settings:
      webhook: $${SLACK_WEBHOOK}
      channel: my-channel
      template: >

        {{#success build.status}} ✔ {{ else }} :x: {{/success}} {{ uppercasefirst build.status }}: Build #{{ build.number }} * (type: `{{ build.event }}`)

        Repository:  <https://github.com/{{ repo.name }}>

        Commit: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commit/{{ build.commit }}|{{ truncate build.commit 8 }}>

        Branch: <https://github.com/{{ repo.owner }}/{{ repo.name }}/commits/{{ build.branch }}|{{ build.branch }}>

        Author: {{ build.author }}

        Build: <{{ build.link }}| Drone Build {{ build.number }} ↗>
    when:
      event: [push]
      status: [success, failure]
      branch: [master]
    depends_on:
      - test

step test ends with an error, because no such command

image

in the slack message that the build was successful

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions