Skip to content

Allow precondition to skip with warning in addition to failing. #1991

@simonrouse9461

Description

@simonrouse9461

Description

Currently, a task will fail if any of the preconditions fails. It will be very helpful to allow a task to skip conditionally without failing.

Proposal:

tasks:
  my-task:
    preconditions:
      - test $a = 1
      - sh: test $b = 2
        action: skip
        msg: "Skip!"
      - sh: test $c = 3
        action: fail
        msg: "Fail!"
  cmds:
    - echo Hello World
  • if $a != 1, the task will fail by default.
  • if $b != 2, the task will skip with a warning "Skip!".
  • if $c != 3, the task will fail with message "Fail!".
  • if both $b != 2 and $c != 3, the task will skip instead of failing.

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