-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI Pipeline Runs example/example.py #151
base: main
Are you sure you want to change the base?
Conversation
…ith parameters of created item. example.py reads vault id from env var. Call to run example.py added to pipeline
…or. Edited GitHub Secret names to match.
@@ -20,6 +20,7 @@ jobs: | |||
matrix: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving a comment here since GitHub UI doesn't allow me to do this above - since this is no longer running only integration tests, let's rename it to test-trusted
instead of integration-test-trusted
.
- run: | | ||
echo "Example file ran successfully!" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this, as silence is golden.
This folder contains a code snippet that demonstrates how to use the 1Password Python SDK to retrieve a secret from 1Password and export it as an environment variable. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test example does much more, though - have we copy pasted this from somewhere?
## Prerequisites | ||
|
||
1. Clone the repository and follow the steps to [get started](https://github.com/1Password/onepassword-sdk-python/blob/main/README.md). | ||
2. Make sure to export a valid service account token. For example: | ||
```bash | ||
export OP_SERVICE_ACCOUNT_TOKEN="<your token>" | ||
``` | ||
3. Make sure to export a valid vault uuid. For example: | ||
```bash | ||
export OP_VAULT_ID="<your vault uuid>" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't actually explain how to run the example file
Altered logic in
example/example.py
to read the previously hardcodedvault_id
from environment variables.Added
example/example.py
to the validation workflow, and readOP_SERVICE_ACCOUNT_TOKEN
andOP_VAULT_ID
from GitHub secrets.Altered the example
client.secrets.resolve
to resolve field from item created during theexample.py
item CRUD.