title: Check for element in an array in Github action script
body: <p>I have two arrays defined in a Github action. Target is to check in which array a given element exists.</p>
  <p><code>Problem:</code> When using <code>contains</code> function, Github action seems to compare substrings even in case of array. While <a href="https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#contains" rel="nofollow noreferrer">this</a> documentation seems to say that it is only the case when searching within string.</p>
  <p>My code looks like below:</p>
  <pre><code>
  name: My action
  
  on:
    push:
      branches:
        - '**'
  
  jobs:
    build:
  
      runs-on: ubuntu-latest
      env:
          JUICE: |
            [
              &quot;apple-juice&quot;,
              &quot;orange-juice&quot;
            ]
          FRUIT: |
            [
              &quot;apple&quot;,
              &quot;orange&quot;
            ]
            
  
      - name: check juice
        if: contains(env.JUICE, 'apple')
        run: |
          echo &quot;Found Juice&quot;
  
      - name: check fruit
        if: contains(env.FRUIT, 'apple')
        run: |
          echo &quot;Found Fruit&quot;
  
  </code></pre>
  <p><code>Output:</code> Both <code>check juice</code> and <code>check fruit</code> steps are getting executed. While I expect only <code>check fruit</code> to run.</p>
  <p>Is there anyway to achieve this?</p>