load-secrets-action icon indicating copy to clipboard operation
load-secrets-action copied to clipboard

How to load a json?

Open himself65 opened this issue 10 months ago • 2 comments

Question as title, Im trying to put a json in 1password and load it in CI. but what I see is the result removes " in the object and cause parsing error

himself65 avatar Feb 02 '25 05:02 himself65

Hi, I'm trying to achieve the same thing. Did you find a good way to do it? Can you share your approach?

Thanks 🙏

loick avatar Mar 22 '25 17:03 loick

Hi, I'm trying to achieve the same thing. Did you find a good way to do it? Can you share your approach?

Thanks 🙏

Nope, i dont load json in 1password now

himself65 avatar Mar 22 '25 20:03 himself65

@himself65 Hey. Could you please give more details about your use case? What kind of item is that Login, Document? Are you reading json from attached file or other field?

volodymyrZotov avatar Sep 03 '25 13:09 volodymyrZotov

I stumbled upon this today with a secret containing a line similar to this:

SOME_SERVICE_NODES='["https://my-node1","https://my-node2","https://my-node3"]'

I was able to solve it by passing the secret as an environment variable into my step like so:

- name: Load Secrets
  id: load_secrets
  uses: 1password/load-secrets-action@v3
  env:
    OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
    SECRET_LINE: "op://My Secrets Vault/Some Secret/value"
- name: Output Secret
  env:
    SECRET: ${{ steps.load_secrets.outputs.SECRET_LINE }}
  run: |
    echo "$SECRET" > some.env

kleinmann avatar Nov 11 '25 10:11 kleinmann