Skip to content

Commit 1c443d8

Browse files
Update README.md to show examples of using as step outputs and env vars
1 parent 867fee7 commit 1c443d8

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,41 @@ Read more on the [1Password Developer Portal](https://developer.1password.com/do
2323

2424
## ✨ Quickstart
2525

26+
### Use secrets from step output (recommended)
2627
```yml
2728
on: push
2829
jobs:
2930
hello-world:
3031
runs-on: ubuntu-latest
3132
steps:
32-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3334

3435
- name: Load secret
35-
uses: 1password/load-secrets-action@v2
36+
id: load_secret
37+
uses: 1password/load-secrets-action@v3
38+
env:
39+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
40+
SECRET: op://app-cicd/hello-world/secret
41+
42+
- name: Print masked secret
43+
run: 'echo "Secret: ${{ steps.load_secrets.outputs.SECRET }}"'
44+
# Prints: Secret: ***
45+
```
46+
47+
### Export secrets as env variables
48+
```yml
49+
on: push
50+
jobs:
51+
hello-world:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- name: Load secret
57+
id: load_secret
58+
uses: 1password/load-secrets-action@v3
3659
with:
37-
# Export loaded secrets as environment variables
38-
export-env: true
60+
export-env: 'true'
3961
env:
4062
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
4163
SECRET: op://app-cicd/hello-world/secret

0 commit comments

Comments
 (0)