Skip to content

Commit

Permalink
feat: Add debugging mode option
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederick888 committed Sep 23, 2022
1 parent 8bf1db7 commit bd23ab6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
description: Preprocess git-log format using gh Go template
required: false
default: "1"
debug:
description: Enable debugging mode
required: false
default: "0"
runs:
using: "composite"
steps:
Expand All @@ -25,6 +29,7 @@ runs:
git checkout "$GITHUB_HEAD_REF"
printf 'y' | \
GH_PH_PAGER='cat' \
GH_PH_DEBUG='${{ inputs.debug }}' \
GH_PH_HISTORY_FENCE='${{ inputs.fence }}' \
GH_PH_HISTORY_FORMAT='${{ inputs.format }}' \
GH_PH_HISTORY_FORMAT_FENCE='${{ inputs.format_fence }}' \
Expand Down
5 changes: 5 additions & 0 deletions gh-ph
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
set -e
set -o pipefail

: "${GH_PH_DEBUG:="0"}"
if [[ "$GH_PH_DEBUG" -ne 0 ]]; then
set -x
fi

: "${GH_PH_HISTORY_FENCE:="=== GH HISTORY FENCE ==="}"
: "${GH_PH_HISTORY_FORMAT:="### %H %s%n%n%b%n"}"
: "${GH_PH_HISTORY_FORMAT_FENCE:="=== GH HISTORY FORMAT FENCE ==="}"
Expand Down

0 comments on commit bd23ab6

Please sign in to comment.