From 867fee7815c206db16c4c5ced27fae7cafe4d861 Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Wed, 13 Aug 2025 17:03:58 -0500 Subject: [PATCH 1/4] Set `export-env` input to false by default --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 4e815e4..fac55de 100644 --- a/action.yml +++ b/action.yml @@ -10,7 +10,7 @@ inputs: default: "false" export-env: description: Export the secrets as environment variables - default: "true" + default: "false" version: description: Specify which 1Password CLI version to install. Defaults to "latest". default: "latest" From 1c443d83daee9c36c582d1548c1d4adac890d1fe Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Wed, 13 Aug 2025 17:35:23 -0500 Subject: [PATCH 2/4] Update README.md to show examples of using as step outputs and env vars --- README.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bfec9d7..ea2c374 100644 --- a/README.md +++ b/README.md @@ -23,19 +23,41 @@ Read more on the [1Password Developer Portal](https://developer.1password.com/do ## ✨ Quickstart +### Use secrets from step output (recommended) ```yml on: push jobs: hello-world: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Load secret - uses: 1password/load-secrets-action@v2 + id: load_secret + uses: 1password/load-secrets-action@v3 + env: + OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} + SECRET: op://app-cicd/hello-world/secret + + - name: Print masked secret + run: 'echo "Secret: ${{ steps.load_secrets.outputs.SECRET }}"' + # Prints: Secret: *** +``` + +### Export secrets as env variables +```yml +on: push +jobs: + hello-world: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Load secret + id: load_secret + uses: 1password/load-secrets-action@v3 with: - # Export loaded secrets as environment variables - export-env: true + export-env: 'true' env: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} SECRET: op://app-cicd/hello-world/secret From 909c7e01f1252f4ba205ce9a1b89ddc6c2df1e59 Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Wed, 13 Aug 2025 17:41:42 -0500 Subject: [PATCH 3/4] Fix formatting --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ea2c374..9fe05b6 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Read more on the [1Password Developer Portal](https://developer.1password.com/do ## ✨ Quickstart ### Use secrets from step output (recommended) + ```yml on: push jobs: @@ -45,6 +46,7 @@ jobs: ``` ### Export secrets as env variables + ```yml on: push jobs: @@ -57,7 +59,7 @@ jobs: id: load_secret uses: 1password/load-secrets-action@v3 with: - export-env: 'true' + export-env: "true" env: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} SECRET: op://app-cicd/hello-world/secret From ba891d4bf215e8c04b85d9de2364325ba7b9a0d0 Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Thu, 14 Aug 2025 09:59:24 -0500 Subject: [PATCH 4/4] Update readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9fe05b6..b4e7c76 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Read more on the [1Password Developer Portal](https://developer.1password.com/do ## ✨ Quickstart -### Use secrets from step output (recommended) +### Export secrets as a step's output (recommended) ```yml on: push @@ -56,10 +56,10 @@ jobs: - uses: actions/checkout@v4 - name: Load secret - id: load_secret uses: 1password/load-secrets-action@v3 with: - export-env: "true" + # Export loaded secrets as environment variables + export-env: true env: OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} SECRET: op://app-cicd/hello-world/secret