Skip to content
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

run sample in pipeline #22

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ jobs:
- name: Test
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
run: npm test
run: |
npm test
npm run commonjs-example
npm run esm-example

3 changes: 2 additions & 1 deletion examples/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ async function fetchSecret() {
});

// Fetches a secret.
return await client.secrets.resolve("op://vault/item/field");
// See syntax here: https://developer.1password.com/docs/cli/secrets-reference-syntax/
return await client.secrets.resolve("op://SDKs Test/Test Login/username");
}

fetchSecret().then(console.log)
3 changes: 2 additions & 1 deletion examples/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ const client = await createClient({
});

// Fetches a secret.
const secret = await client.secrets.resolve("op://vault/item/field");
// See syntax here: https://developer.1password.com/docs/cli/secrets-reference-syntax/
const secret = await client.secrets.resolve("op://SDKs Test/Test Login/username");
console.log(secret)
Loading