From 1c443d83daee9c36c582d1548c1d4adac890d1fe Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Wed, 13 Aug 2025 17:35:23 -0500 Subject: [PATCH] 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