Skip to content

Commit

Permalink
Add debug argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mre committed Aug 11, 2022
1 parent c2c86e5 commit 3731988
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ jobs:
format: doesnotexist # gets ignored if format set in args
output: /tmp/foo.txt
fail: true
- name: test debug
uses: ./
with:
debug: true
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
description: "Lychee arguments (https://github.com/lycheeverse/lychee#commandline-parameters)"
default: "--verbose --no-progress './**/*.md' './**/*.html'"
required: false
debug:
description: "Enable debug output in action (set -x). Helpful for troubleshooting."
default: false
required: false
fail:
description: "Fail entire pipeline on error (i.e. when lychee exit code is not 0)"
default: false
Expand Down Expand Up @@ -46,10 +50,11 @@ runs:
# https://github.com/actions/runner/issues/665
INPUT_GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
INPUT_ARGS: ${{ inputs.ARGS }}
INPUT_FORMAT: ${{ inputs.FORMAT }}
INPUT_OUTPUT: ${{ inputs.OUTPUT }}
INPUT_DEBUG: ${{ inputs.DEBUG }}
INPUT_FAIL: ${{ inputs.FAIL }}
INPUT_FORMAT: ${{ inputs.FORMAT }}
INPUT_JOBSUMMARY: ${{ inputs.JOBSUMMARY }}
INPUT_OUTPUT: ${{ inputs.OUTPUT }}
shell: bash
branding:
icon: "external-link"
Expand Down
8 changes: 7 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash -l
set -uxo pipefail
set -uo pipefail

# Enable optional debug output
if [ "${INPUT_DEBUG}" = true ]; then
echo "Debug output enabled"
set -x
fi

LYCHEE_TMP="/tmp/lychee/out.md"
GITHUB_WORKFLOW_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true"
Expand Down

0 comments on commit 3731988

Please sign in to comment.