title: How to deal with long conditional expression in Github Actions Workflow
body: <p>How to best deal with long conditional expressions in GitHub Actions Workflow?</p>
  <p>I have a workflow that I want to run in 2 cases:</p>
  <ol>
  <li>when a pull request is closed</li>
  <li>when a comment containing a specific string is created on a pull request</li>
  </ol>
  <p>This leads to a workflow definition with a long <code>if</code> expression:</p>
  <pre class="lang-yaml prettyprint-override"><code>on:
    pull_request:
      types: [ closed ]
    issue_comment:
      types: [ created ]
  jobs:
    do:
      if: ${{ github.event_name == 'pull_request' || (github.event_name == 'issue_comment' &amp;&amp; github.event.issue.pull_request &amp;&amp; contains(github.event.comment.body, 'specific string')) }}
      steps:
        ...
  </code></pre>
  <p>A solution I see is to split the workflow in 2 definitions, but I'd like to avoid this due to DRY.</p>
  <p>Ideas I searched for, but did not find working solutions for:</p>
  <ul>
  <li>define the expression on multiple lines</li>
  <li>split the if in multiple if expressions</li>
  </ul>