Skip to content

{{ datetime }} => Evaluation error: Helper datetime called with argument 0 with type int64 but it should be float64 #123

@waterdrop01

Description

@waterdrop01

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:

Screenshot from 2021-07-06 21-30-40

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!

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