drone-slack
drone-slack copied to clipboard
{{ datetime }} => Evaluation error: Helper datetime called with argument 0 with type int64 but it should be float64
Hello,
I try to use datetime in my .drone.yml
:
- name: slack
image: plugins/slack
settings:
webhook:
from_secret: slack-drone-webhook
channel: alert-drone
link_names: true
template: >
{{#success build.status}}✅{{else}}🐞{{/success}} Build #{{build.number}} of {{repo.name}}@{{build.tag}}
📝 `{{commit.message}}`
🙇 {{commit.author}}
🕐 {{datetime build.started "02.01.2006 15:04" "Europe/Berlin"}}
🌐 {{build.link}}
but this produce the following error:
2021/07/06 19:22:25 Evaluation error: Helper datetime called with argument 0 with type int64 but it should be float64
Current node:
String{Value:'Europe/Berlin', Pos:207}
Any idea how to cast int64
to float64
in the template?
Thanks!
I'm facing the same issue: build.started
is int64
and that function is expecting float64
.
This makes this function unusable with those native time variables if we don't have a way to cast types or something.
has someone solved this issue or has a workaround?