Skip to content

Commit fc05240

Browse files
committed
add debug logging
1 parent f5bb0aa commit fc05240

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

dist/index.js

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/1password.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ export class OnePassword {
105105

106106
async signOut(): Promise<void> {
107107
const env = this.onePasswordEnv
108-
await execWithOutput('op', ['signout', '--account', 'github_action', '--forget'], {env})
108+
await execWithOutput(
109+
'op',
110+
['signout', '--account', 'github_action', '--forget'],
111+
{env}
112+
)
109113
}
110114
}

src/exec.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as exec from '@actions/exec'
2+
import * as core from '@actions/core'
23

34
export async function execWithOutput(
45
command: string,
@@ -9,16 +10,20 @@ export async function execWithOutput(
910
let err = ''
1011

1112
const opt = options ?? {}
12-
opt.silent = true // for debugging set this to false to see the output of 1password
13+
opt.silent = false // for debugging set this to false to see the output of 1password
1314
opt.listeners = {
1415
stdout: (data: Buffer) => {
1516
out += data.toString()
1617
},
1718
stderr: (data: Buffer) => {
1819
err += data.toString().trim()
20+
},
21+
debug: (data: string) => {
22+
core.info(`Debug: ${data}`)
1923
}
2024
}
2125
try {
26+
core.info(`Executing command: ${command} ${args ? args.join(' ') : ''}}`)
2227
await exec.exec(command, args, opt)
2328
} catch {
2429
if (err) {

0 commit comments

Comments
 (0)