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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression functions not available in conditionals or vars values passed to tasks #3646

Open
jessesuen opened this issue Mar 13, 2025 · 2 comments

Comments

@jessesuen
Copy link
Member

Description

If I try to use commitFrom function to pass something to a task, e.g.:

      steps:
      - task:
          name: render-branch
        vars:
        - name: commit
          value: ${{ commitFrom("https://github.com/jessesuen/kargo-rendered-branches.git").ID }}

I get the following error:

step execution failed: step 0 met error threshold of 1: failed to get step config: error pre-processing promotion variable "commit": reflect: call of reflect.Value.Call on zero Value (1:2) | commitFrom("https://github.com/jessesuen/kargo-rendered-branches.git").ID | .^

But the same commitFrom will work as a normal step:

      steps:
      - uses: git-clone
        config:
          repoURL: https://github.com/jessesuen/kargo-rendered-branches.git
          checkout:
          - commit: ${{ commitFrom("https://github.com/jessesuen/kargo-rendered-branches.git").ID }}
            path: ./src

Screenshots

Image

Steps to Reproduce

Try to use commitFrom in a vars[].value passed to a task.

Version

v1.3.1
@jessesuen jessesuen changed the title Expression functions not available in vars values passed to tasks Expression functions not available in conditionals or vars values passed to tasks Mar 13, 2025
@jessesuen
Copy link
Member Author

Conditionals (if) also lack access to functions.

@krancour
Copy link
Member

@jessesuen assigning to you only because I think you said you were working on it.

If I'm wrong of if you need to hand it off, please feel free to kick it back to me.

@krancour krancour added this to the v1.3.2 milestone Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants