---
version: '1.0'
description: Mistral get commit shas subworkflow
input:
  - host
  - repos
output:
  - shas: <% ctx().shas %>
tasks:
  get_mistral_sha:
    action: core.remote
    input:
      hosts: <% ctx().host %>
      cmd: cd <% ctx().repos.get(mistral) %> && echo `git rev-parse HEAD`
    next:
      - when: <% succeeded() %>
        do:
          - get_mistralclient_sha
  get_mistralclient_sha:
    action: core.remote
    input:
      hosts: <% ctx().host %>
      cmd: cd <% ctx().repos.get(mistralclient) %> && echo `git rev-parse HEAD`
    next:
      - when: <% succeeded() %>
        do:
          - compose_shas
  compose_shas:
    action: core.noop
    next:
      - when: <% succeeded() %>
        publish:
          - shas: <% dict(mistral => result().get(ctx().host).stdout,
                          mistralclient => result().get(ctx().host).stdout) %>

---
version: '1.0'
description: Mistral get commit shas subworkflow
input:
  - host
  - repos
output:
  - shas: <% ctx().shas %>
tasks:
  get_mistral_sha:
    action: core.remote
    input:
      hosts: <% ctx().host %>
      cmd: cd <% ctx().repos.get(mistral) %> && echo `git rev-parse HEAD`
    next:
      - when: <% succeeded() %>
        do:
          - get_mistralclient_sha
  get_mistralclient_sha:
    action: core.remote
    input:
      hosts: <% ctx().host %>
      cmd: cd <% ctx().repos.get(mistralclient) %> && echo `git rev-parse HEAD`
    next:
      - when: <% succeeded() %>
        do:
          - compose_shas
  compose_shas:
    action: core.noop
    next:
      - when: <% succeeded() %>
        publish:
          - shas: <% dict(mistral       => task(get_mistral_sha).result.get(ctx().host),
                          mistralclient => task(get_mistralclient_sha).result.get(ctx().host)) %>

Use task(get_mistral..._sha).result instead of result() when getting commit SHAs
Use task(get_mistral..._sha).result instead of result() when getting commit SHAs

See execution 5c6cd7d016f3ad79c1dd5a1b
