Drillster / drone-email

Drone plugin for sending email notifications
Apache License 2.0
46 stars 43 forks source link

build.link shows commit, not build #73

Open sebphi opened 1 year ago

sebphi commented 1 year ago

Hi! Sorry in advance if this is not the right place.

We use drone-email successfully with woodpecker (replacement for drone) and the email which is sent on e.g. failure contains a link to the commit that supposedly caused the failure. However, the email text says Failed build #xxx and it would make more sense to me if the link actually lead to the build (often enough, it's not the commit causing the fail, but something else in our build chain).

If i see that right, the template uses build.link and that is set by the environment variable DRONE_BUILD_LINK which already contains the erroneous link (found out by an echo command in a build step). Is there something that can be done within the notify step to set DRONE_BUILD_LINK to the proper value? Here is what that step looks like atm:

  notify:
    image: docker-proxy/drillster/drone-email
    pull: true
    settings:
      host: mail.domain
      from: woodpecker@domain
      username: mailsender
      password:
        from_secret: email_password
      recipients:
      - woodpecker@domain
      starttls: true
    when:
      event: [push, pull_request]
      status:
      - failure
      - success

I have tried commands and environment so far, to no avail.

Or is this something which would need to be fixed in woodpecker (or somewhere else)?

Thanks in advance,