title: Check in github action if branch exists
body: <p>I want to check inside a github action whether a branch (e.g. &quot;main&quot;) exists. I tried</p>
  <pre><code>    - name: get Branch
        run: |
          export BRANCHES=git branch -r
          echo &quot;${{ contains($BRANCHES, 'main') }}&quot;
  </code></pre>
  <p>But this is apparently a syntax error.</p>
  <p>Can somebody tell me how to do this properly?</p>