diff --git a/README.md b/README.md index fb3c7ec..d4e1192 100644 --- a/README.md +++ b/README.md @@ -283,6 +283,12 @@ we recommend migrating to this consolidated action that has additional capabilit See the [migration guide](MIGRATION.md) for more information. +## Debugging + +To debug the action, rerun the workflow with debug logging enabled. +This will run all buf commands with the `--debug` flag. +See the [re-run jobs with debug logging](https://github.blog/changelog/2022-05-24-github-actions-re-run-jobs-with-debug-logging/) for more information. + ## Feedback and support If you have any feedback or need support, please reach out to us on the [Buf Slack][slack], diff --git a/dist/index.js b/dist/index.js index 980290f..2f48abb 100644 --- a/dist/index.js +++ b/dist/index.js @@ -46049,6 +46049,9 @@ var Status; })(Status || (Status = {})); // run executes the buf command with the given arguments. async function run(bufPath, args) { + if (core.isDebug()) { + args = ["--debug", ...args]; + } return exec.getExecOutput(bufPath, args, { ignoreReturnCode: true, env: { diff --git a/src/main.ts b/src/main.ts index 43ad520..bcd93c3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -405,6 +405,9 @@ interface Result extends exec.ExecOutput { // run executes the buf command with the given arguments. async function run(bufPath: string, args: string[]): Promise { + if (core.isDebug()) { + args = ["--debug", ...args]; + } return exec .getExecOutput(bufPath, args, { ignoreReturnCode: true,