Add extra-input-files parameter to template #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/lycheeverse/lychee-action | |
# https://github.com/lycheeverse/lychee | |
name: Check Links | |
on: | |
push: | |
schedule: | |
# Run monthly | |
# GitHub actions uses UTC for time zone | |
# crontab format: minute hour day-of-month month day-of-week | |
- cron: "18 4 4 * *" | |
workflow_dispatch: | |
inputs: | |
message: | |
description: Message to display in job summary | |
required: false | |
type: string | |
override-args: | |
description: Override default arguments (see https://github.com/lycheeverse/lychee#commandline-parameters) | |
required: false | |
type: string | |
workflow_call: | |
inputs: | |
message: | |
description: Message to display in job summary | |
required: false | |
type: string | |
extra-input-files: | |
description: Additional files to scan for links beyond default *.md and **/*.md | |
required: false | |
type: string | |
override-args: | |
description: Override default arguments (see https://github.com/lycheeverse/lychee#commandline-parameters) | |
required: false | |
type: string | |
exclude: | |
description: URLs excluded from checking (need to include '--exclude' option text in string if using) | |
required: false | |
type: string | |
jobs: | |
link-checker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Print out *.md files to be analyzed | |
uses: lycheeverse/lychee-action@v1 | |
with: | |
args: --verbose --no-progress --dump-inputs ./*.md ./*/*.md ${{ inputs.extra-input-files }} | |
fail: true | |
- name: Link Checker default args | |
if: ${{ !inputs.override-args }} | |
uses: lycheeverse/lychee-action@v1 | |
with: | |
# args: --base . --verbose --no-progress -a '200,403,429,500' './**/*.md' | |
# args: --config ./.github/workflows/lychee.toml './**/*.md' | |
# Need to use ./*.md _and_ ./**/.md because runner shell glob processing does not include current dir | |
# If there are files more than one directory below ., then need to add as extra-input-files | |
args: ${{ inputs.exclude }} --verbose --no-progress -a '200,403,429,500' --base . ./*.md ./*/*.md ${{ inputs.extra-input-files }} | |
fail: true | |
- name: Link Checker user-supplied args | |
if: ${{ inputs.override-args }} | |
uses: lycheeverse/lychee-action@v1 | |
with: | |
# args: --base . --verbose --no-progress -a '200,403,429,500' './**/*.md' | |
# args: --config ./.github/workflows/lychee.toml './**/*.md' | |
args: ${{ inputs.override-args }} | |
fail: true | |
- name: Print the job summary | |
if: ${{ inputs.message }} | |
run: | | |
echo ${{ inputs.message }} >$GITHUB_STEP_SUMMARY |