Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
waterdrop01 opened this issue Jul 6, 2021 · 2 comments

Comments

@waterdrop01
Copy link

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!

@ErvalhouS
Copy link

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.

@divramod
Copy link

divramod commented Aug 4, 2023

has someone solved this issue or has a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants