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

dag: Support step continueOn based on command output and exitcode #769

Open
yohamta opened this issue Jan 3, 2025 · 0 comments
Open

dag: Support step continueOn based on command output and exitcode #769

yohamta opened this issue Jan 3, 2025 · 0 comments
Assignees

Comments

@yohamta
Copy link
Collaborator

yohamta commented Jan 3, 2025

Background

Currently, the continueOn configuration for DAG steps only supports static conditions like exit codes. There's a need to make this more dynamic by allowing continuation decisions based on the actual command output.

Proposed Feature

Add support for output-based conditions in the continueOn configuration. This would allow steps to continue execution even after a failure if the command output matches specified patterns.

steps:
  # 1. Continue on based on exit code
  - name: step 1
    command: echo hello
    continueOn:
      exitCode: [0,1] # continue on if the exitcode is one of these
      
  # 2. Continue on based on stderr / stdout
  - name: step 2
    command: echo hello
    continueOn: # continue of if the stdout/stderr contains the following outputs
      stderr: "hello"
      stdout: "bye"
        
  # 3. Continue on based on environment variable / command substitution
  - name: step 3
    command: echo hello
    output: FOO
    continueOn:
      condition: "$FOO" # This can be a command substitution such as: condition: "`echo $FOO`".
      expected: # continue on if $FOO contains one of the expected texts
        - "hello"
        - "bye"
 
  # 4. Continue on based on the output value
  - name: step 4
    command: echo hello
    output: FOO
    continueOn:
      output: # continue on if $FOO contains one of the expected texts
        - "hello"
        - "bye"
@yohamta yohamta changed the title dag: Support step continueOn based on command output matching dag: Support step continueOn based on command output and exitcode Jan 3, 2025
@yohamta yohamta self-assigned this Jan 3, 2025
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

1 participant