Skip to content

Commit

Permalink
container: correctly propagate debug mode everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup committed Sep 6, 2024
1 parent 89f61ac commit d546089
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions container/cmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ is_true() {
esac
}

debug_mode=false
if is_true "$INPUT_DEBUG" || is_true "$RUNNER_DEBUG"; then
debug_mode=true
( echo "== GitHub ENV VARS ==" ; env | grep -e ^GITHUB -e ^INPUT_ ) >&2
set -x
fi

linter_options=()
set_linter_options()
{
if is_true "$INPUT_DEBUG" || is_true "$RUNNER_DEBUG"; then
if $debug_mode; then
linter_options+=( --log-level=debug )
fi
for tag in $INPUT_LINTER_TAGS; do
Expand Down Expand Up @@ -78,7 +80,7 @@ if test "$GITHUB_EVENT_NAME" = 'pull_request'; then

(
echo "## Rebasing $INPUT_PULL_REQUEST_HEAD onto $target_branch ##"
is_true "$INPUT_DEBUG" || exec &>/dev/null
$debug_mode || exec &>/dev/null
git fetch origin "$target_branch:$target_branch"
git fetch origin "+$INPUT_PULL_REQUEST_HEAD:refs/remotes/pull-requests/pr-detached-$INPUT_PULL_REQUEST_ID"
git checkout "$INPUT_PULL_REQUEST_HEAD"
Expand Down

0 comments on commit d546089

Please sign in to comment.