Drillster / drone-email

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

create_time error #48

Closed Famine-Life closed 3 years ago

Famine-Life commented 3 years ago

hi , bro, I'm Chinese , I find drone-email build message has a time zone problem.

maybe, this is Docker's reason , I guess.

tell me yes or why ,please. thank you very mach.

mjwwit commented 3 years ago

The build create time in the default template will use the local time zone. You can change the time zone using the TZ environment variable.

Famine-Life commented 3 years ago

Hi, I tried to modify it many times, but no success. 

always UTC.

can you give a demo?

------------------ 原始邮件 ------------------ 发件人: "Michael de @.>; 发送时间: 2021年7月8日(星期四) 下午4:16 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [Drillster/drone-email] create_time error (#48)

The build create time in the default template will use the local time zone. You can change the time zone using the TZ environment variable.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mjwwit commented 3 years ago

Something like this should work:


steps:
  - name: notify
    image: drillster/drone-email
+   environment:
+     TZ: "Asia/Shanghai"
    settings:
      from: noreply@github.com
      host: smtp.mailgun.org
      recipients:
        - octocat@github.com
mjwwit commented 3 years ago

I'm assuming this fixed your issue. If not, feel free to respond.