Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ they configure.
| --- | --- | --- |
| `config-dir` | empty | `--config-dir` |
| `profile` | empty | `--profile` |
| `debug` | `false` | `--debug` |

### Review Target

Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions scripts/run-diffpal-review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
19 changes: 19 additions & 0 deletions scripts/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down