Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update To latest Release and add Checkbox Option (fixes #274) #279

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ inputs:
required: false
lycheeVersion:
description: "Use custom version of lychee link checker"
default: v0.18.0
default: v0.18.1
required: false
output:
description: "Summary output file path"
default: "lychee/out.md"
required: false
checkbox:
description: "Add Markdown Styled Checkboxes to the output"
default: false
required: false
token:
description: "Your GitHub Access Token, defaults to: {{ github.token }}"
default: ${{ github.token }}
Expand Down Expand Up @@ -117,6 +121,7 @@ runs:
INPUT_FAILIFEMPTY: ${{ inputs.FAILIFEMPTY }}
INPUT_FORMAT: ${{ inputs.FORMAT }}
INPUT_JOBSUMMARY: ${{ inputs.JOBSUMMARY }}
INPUT_CHECKBOX: ${{ inputs.CHECKBOX }}
INPUT_OUTPUT: ${{ inputs.OUTPUT }}
shell: bash
branding:
Expand Down
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ if [[ "$ARGS" =~ "--output " ]] && [ -n "${INPUT_OUTPUT:-}" ]; then
exit 1
fi

# If `--mode task` occurs in args and `INPUT_CHECKBOX` is set, exit with an error
if [[ "$ARGS" =~ "--mode task" ]] && [ -n "${INPUT_CHECKBOX:-}" ]; then
echo "Error: '--mode task' is set in args as well as in the action configuration. Please remove one of them."
exit 1
fi

# Add `--mode task` to args if `INPUT_CHECKBOX` is true
if [[ "${INPUT_CHECKBOX}" = true ]]; then
ARGS="${ARGS} --mode task"
fi

# Execute lychee
eval lychee ${FORMAT} --output ${LYCHEE_TMP} ${ARGS}
LYCHEE_EXIT_CODE=$?
Expand Down