Skip to content

Github action combining if condition or writing it in Multiple lines #25375

Answered by BrightRan
uditgaurav asked this question in Actions
Discussion options

You must be logged in to vote

@uditgaurav,
You can write like as the following:

- name: Running all tests
  if: |
    startsWith(github.event.comment.body, '/run-e2e-all') ||
    startsWith(github.event.comment.body, '/run-e2e-first-test') ||
    startsWith(github.event.comment.body, '/run-e2e-second-test') ||
    startsWith(github.event.comment.body, '/run-e2e-third-test') ||
    startsWith(github.event.comment.body, '/run-e2e-fourth-test') ||
    startsWith(github.event.comment.body, '/run-e2e-fifth-test') ||
    startsWith(github.event.comment.body, '/run-e2e-sixth-test') ||
    startsWith(github.event.comment.body, '/run-e2e-seventh-test') ||
    startsWith(github.event.comment.body, '/run-e2e-eighth-test') ||
   …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants