Skip to content

Add feature to write code in main workflow block and in each steps #212

Open

Description

@0hsn
name: Name of the workflow
code: <% set var_a = 23 %>
steps:
  - name: Title of the step
    uses: fetch

    variables:
      numberOfusers: <% var_a %>
      
    code: <%
      # this block runs after the execution of this step done
      # this will display the content in pretty format when --debug enabled (default)
      debug('_steps.0._response')

      # setting a variable in local variable scope
      set var_s = length('_steps.0._response')
      %>
  - ...

Activity

  1. changed the title [-]Debug or logging back-end[/-] [+]Add debugging in workflow steps and overall workflow[/+] on Dec 30, 2024
  2. changed the title [-]Add debugging in workflow steps and overall workflow[/-] [+]Add feature to write `code` in main workflow block and in each steps[/+] on Dec 30, 2024
  3. 0hsn commented on Dec 31, 2024

    @0hsn
    MemberAuthor

    Another idea

    • There can be before and after block for each step
    • And no global code block
    Caveats
    • This can help debug before and after executions; also adds flexibility to alter variables and data before and after execution
    • This adds more complexity and welcomes nasty codes

    eg:

    name: Name of the workflow
    steps:
      - name: Title of the step
        uses: fetch
    
        variables:
          numberOfusers: <% var_a %>
          
        before: <%
          # this block runs after the execution of this step done
          # this will display the content in pretty format when --debug enabled (default)
          debug('_steps.0._response')
    
          # setting a variable in local variable scope
          set var_s = length('_steps.0._response')
          %>
    
        after: <%
          # this block runs after the execution of this step done
          # this will display the content in pretty format when --debug enabled (default)
          debug('_steps.0._response')
    
          # setting a variable in local variable scope
          set var_s = length('_steps.0._response')
          %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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