Drillster / drone-email

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

Use /run/drone/env as default PLUGIN_ENV_FILE, overwrite env vars with it #40

Closed immerrr closed 4 years ago

immerrr commented 4 years ago

DISCLAIMER: first time ever touching Go code, so feel free to request any updates to styling or the approach itself, or even do it yourself (I have enabled edits by maintainers).

It is required for the plugin to work correctly with Kubernetes runner, where environment variables are created before the pipeline is finished and thus initial DRONE_BUILD_STATUS is always "success".

Related discourse topic:

https://discourse.drone.io/t/drone-build-status-always-success-in-kubernetes/6627/2

Similar workaround in drone-slack:

https://github.com/drone-plugins/drone-slack/blob/59d3676b1cb7dbbdd9ca4b677570cd510ed8929a/main.go#L187-L189

immerrr commented 4 years ago

@mjwwit apologies in advance, are you the person to reach out to see if this can be accepted?

mjwwit commented 4 years ago

I must have missed this PR... Thanks for the reminder! I like the idea, I'll test it later today and merge it if everything works out.

mjwwit commented 4 years ago

It works great, thanks!