Difference between revisions of "Uses: 1password/load-secrets-action"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
[[uses:]] [[1password/]]load-secrets-action | [[uses:]] [[1password/]]load-secrets-action | ||
[[uses:]] [[1password/]]load-secrets-action@v2 | [[uses:]] [[1password/]]load-secrets-action@v2 | ||
+ | |||
+ | <pre> | ||
+ | on: push | ||
+ | jobs: | ||
+ | hello-world: | ||
+ | runs-on: ubuntu-latest | ||
+ | steps: | ||
+ | - uses: actions/checkout@v3 | ||
+ | |||
+ | - name: Load secret | ||
+ | uses: 1password/load-secrets-action@v2 | ||
+ | with: | ||
+ | # 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 | ||
+ | |||
+ | - name: Print masked secret | ||
+ | run: 'echo "Secret: $SECRET"' | ||
+ | # Prints: Secret: *** | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | |||
- name: Load secrets from 1Password | - name: Load secrets from 1Password | ||
Line 12: | Line 37: | ||
DOCKERHUB_USERNAME: op://xxxxxx/USERNAME | DOCKERHUB_USERNAME: op://xxxxxx/USERNAME | ||
DOCKERHUB_TOKEN: op://yyyyyyy/TOKEN | DOCKERHUB_TOKEN: op://yyyyyyy/TOKEN | ||
+ | |||
+ | |||
+ | Error: could not read secret 'op://XXXXX/APIKEY/secret': item 'XXXXX/APIKEY' does not have a field '[[secret]]' | ||
== See also == | == See also == |
Latest revision as of 23:39, 23 October 2024
uses: 1password/load-secrets-action uses: 1password/load-secrets-action@v2
on: push jobs: hello-world: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Load secret uses: 1password/load-secrets-action@v2 with: # 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 - name: Print masked secret run: 'echo "Secret: $SECRET"' # Prints: Secret: ***
- name: Load secrets from 1Password uses: 1password/load-secrets-action@v2 with: export-env: true env: OP_TOKEN: ${{ secrets.OP_TOKEN }} DOCKERHUB_USERNAME: op://xxxxxx/USERNAME DOCKERHUB_TOKEN: op://yyyyyyy/TOKEN
Error: could not read secret 'op://XXXXX/APIKEY/secret': item 'XXXXX/APIKEY' does not have a field 'secret'
See also[edit]
uses:, checkout@v3, configure-aws-credentials, docker/login-action, 1password/
- 1password,
op
, Privnote, Kolide, 1password connect, 1password Kubernetes Injector,1password-cli, kind: OnePasswordItem
, 1Password Browser extension,uses: 1password/load-secrets-action@v2
, 1Password Watchtower, 1Password Secrets Automation, 1password secret key, 1password Kubernetes operator, operator logs
Advertising: