<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: {{ include &quot;backstage.fullname&quot; . }}-backend
type: Opaque
stringData:
  GH_APP_PRIVATEKEY_BASE:|-
{{ .Values.auth.ghApp.privateKey | quote | b64dec | indent 2 }}
</code></pre>
<p>Getting <code>error converting YAML to JSON: yaml: line 22: could not find expected ':'</code> as the result when</p>
<p>trying to store a base64 encoded string to <code>GH_APP_PRIVATEKEY_BASE</code></p>
<p>My application (backstage) is using helm charts to map the env secret.</p>
<p>I keep having trouble with storing/passing multi-line RSA. private key,</p>
<p>Currently trying to base64 encoded private key into one-liner, but still failed at validating the secret file.  Would love to know other approach like passing a file with key written on it?</p>
<p>BTW, I use <code>GITHUB_PRVATE_KEY=$(echo -n $GITHUB_PRVATE_KEY | base64 -w 0)</code> and</p>
<pre><code>helm_overrides=&quot;$helm_overrides --set auth.ghApp.clientSecret=$GITHUB_PRVATE_KEY&quot;
</code></pre>
<p>at GitHub action to encoded the private key.</p>

Peter
<p>Try increase the indent to 4:</p>
<pre><code>...
stringData:
  GH_APP_PRIVATEKEY_BASE: |-
{{ .Values.auth.ghApp.privateKey | quote | b64dec | indent 4 }}
</code></pre>
