diff --git a/README.md b/README.md index 1c302b8..0eab13c 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ they configure. | --- | --- | --- | | `config-dir` | empty | `--config-dir` | | `profile` | empty | `--profile` | +| `debug` | `false` | `--debug` | ### Review Target diff --git a/action.yml b/action.yml index cb85b19..a251970 100644 --- a/action.yml +++ b/action.yml @@ -75,6 +75,10 @@ inputs: description: Path to additional review instructions. required: false default: "" + debug: + description: Pass --debug to DiffPal. + required: false + default: "" runs: using: composite steps: @@ -104,4 +108,5 @@ runs: INPUT_LANGUAGE: ${{ inputs.language }} INPUT_INSTRUCTIONS: ${{ inputs.instructions }} INPUT_INSTRUCTIONS_FILE: ${{ inputs.instructions-file }} + INPUT_DEBUG: ${{ inputs.debug }} run: ${{ github.action_path }}/scripts/run-diffpal-review.sh diff --git a/scripts/run-diffpal-review.sh b/scripts/run-diffpal-review.sh index 1829a9c..d9fc21e 100755 --- a/scripts/run-diffpal-review.sh +++ b/scripts/run-diffpal-review.sh @@ -43,6 +43,9 @@ fi if [[ -n "${INPUT_PROFILE:-}" ]]; then argv+=(--profile "$INPUT_PROFILE") fi +if truthy "${INPUT_DEBUG:-false}"; then + argv+=(--debug) +fi argv+=(review github --base "$INPUT_BASE" --head "$INPUT_HEAD") diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index 3519e7e..6e250cf 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -153,6 +153,24 @@ test_wrapper_uses_installed_binary_and_feedback() { assert_contains "$argv" "diffpal-dev" } +test_wrapper_forwards_debug_input() { + local dir="$1" + local bin_dir="$dir/debug-bin" + local argv="$dir/argv-debug" + mkdir -p "$bin_dir" + make_fake_diffpal "$bin_dir" + + PATH="$bin_dir:$PATH" \ + DIFFPAL_ARGV_FILE="$argv" \ + DIFFPAL_BIN=diffpal \ + INPUT_BASE=base-sha \ + INPUT_HEAD=head-sha \ + INPUT_DEBUG=true \ + "$repo_root/scripts/run-diffpal-review.sh" + + assert_contains "$argv" "--debug" +} + test_wrapper_can_disable_summary_overview() { local dir="$1" local bin_dir="$dir/overview-bin" @@ -235,6 +253,7 @@ test_installer_installs_requested_version "$tmpdir/install" test_installer_selects_custom_path "$tmpdir/custom" test_installer_selects_path_when_install_disabled "$tmpdir/disabled" test_wrapper_uses_installed_binary_and_feedback "$tmpdir/wrapper-installed" +test_wrapper_forwards_debug_input "$tmpdir/wrapper-debug" test_wrapper_can_disable_summary_overview "$tmpdir/wrapper-overview" test_wrapper_prints_gate_annotation_for_blocked_exit_code "$tmpdir/wrapper-gate" test_wrapper_keeps_non_gate_failures_generic "$tmpdir/wrapper-generic"