Skip to content

Commit c6d4525

Browse files
Merge pull request #38 from UmbrellaDocs/stats
Add support for showing stats
2 parents 808d98b + c311faf commit c6d4525

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

Diff for: README.md

+7
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ Default is `false`.
7676
(Optional) Path to your linkspector configuration file `.linkspector.yml`.
7777
For more details, see [Linkspector configuration](https://github.com/UmbrellaDocs/linkspector?tab=readme-ov-file#configuration).
7878

79+
### `show_stats`
80+
81+
(Optional) Show statistics about the checked links [true,false].
82+
Default is `false`.
83+
84+
**Note:** Enabling the `show_stats` option causes Linkspector to run twice: once for reporting and again to collect statistics. Using this will increase the total run time of the action.
85+
7986
### Real-life usage samples
8087

8188
Following is a list of some of the repositories which are using GitHub Action -

Diff for: action.yml

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ inputs:
4343
description: Specify the path for the Linkspector YML configuration file.
4444
required: true
4545
default: .linkspector.yml
46+
show_stats:
47+
description: Show statistics about the checked links.
48+
required: false
49+
default: "false"
4650
runs:
4751
using: composite
4852
steps:
@@ -76,6 +80,7 @@ runs:
7680
INPUT_FAIL_LEVEL: ${{ env.INPUT_FAIL_LEVEL }}
7781
INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }}
7882
INPUT_CONFIG_FILE: ${{ inputs.config_file }}
83+
INPUT_SHOW_STATS: ${{ inputs.show_stats }}
7984
branding:
8085
icon: link-2
8186
color: blue

Diff for: script.sh

+7
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,11 @@ linkspector check -c "${INPUT_CONFIG_FILE}" -j |
3333
"${INPUT_REVIEWDOG_FLAGS}"
3434
exit_code=$?
3535
echo '::endgroup::'
36+
37+
if [ "${INPUT_SHOW_STATS}" = "true" ]; then
38+
echo '::group:: Running linkspector stats ...'
39+
linkspector check -c "${INPUT_CONFIG_FILE}" -s || true
40+
echo '::endgroup::'
41+
fi
42+
3643
exit $exit_code

0 commit comments

Comments
 (0)