title: How to patch multi document yaml file on condition using yq?
body: <p>Having YAML document something like:</p>
  <pre class="lang-yaml prettyprint-override"><code>---
  apiVersion: networking.k8s.io/v1
  kind: NetworkPolicy
  metadata:
    name: allow-scraping
  ---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: allow-webhooks
  </code></pre>
  <p>I am trying to get something like</p>
  <pre class="lang-yaml prettyprint-override"><code>---
  apiVersion: **networking.k8s.io/v1beta1**
  kind: NetworkPolicy
  metadata:
    name: allow-scraping
  ---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: allow-webhooks
  </code></pre>
  <p>So basically get document, if document has <code>kind: NetworkPolicy</code> then patch <code>apiVersion: networking.k8s.io/v1beta1</code>.</p>
  <p>Ideally one liner, ideally with yq v4, but other solutions will be helpful too.</p>