Skip to content

Commit

Permalink
Merge pull request #84 from RobotsAndPencils/debug
Browse files Browse the repository at this point in the history
add debug logging
  • Loading branch information
aerickson14 authored Oct 16, 2024
2 parents f5bb0aa + cc49c4c commit 06a2e5e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
npm install
- run: |
npm run all
test: # make sure the action works
test: # make sure the action works without having to build
strategy:
matrix:
runs-on: [macos-latest, ubuntu-20.04, ubuntu-22.04, ubuntu-latest]
Expand All @@ -30,10 +30,6 @@ jobs:
- name: Checkout Github
uses: actions/checkout@v3
if: ${{ !env.ACT }}
- name: Install dependencies
run: npm install
- name: Build Typescript
run: npm run all
- name: Test Action
uses: ./
id: secrets
Expand Down
3 changes: 2 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/1password.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export class OnePassword {

async signOut(): Promise<void> {
const env = this.onePasswordEnv
await execWithOutput('op', ['signout', '--account', 'github_action', '--forget'], {env})
await execWithOutput(
'op',
['signout', '--account', 'github_action', '--forget'],
{env}
)
}
}
3 changes: 2 additions & 1 deletion src/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export async function execWithOutput(
let out = ''
let err = ''

const isDebug = process.env.ACTIONS_STEP_DEBUG === 'true'
const opt = options ?? {}
opt.silent = true // for debugging set this to false to see the output of 1password
opt.silent = !isDebug
opt.listeners = {
stdout: (data: Buffer) => {
out += data.toString()
Expand Down

0 comments on commit 06a2e5e

Please sign in to comment.