Skip to content
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
581b93f
add markdown link check
YanxuanLiu Aug 15, 2025
770c6f4
add step to analyze
YanxuanLiu Aug 15, 2025
b4a5fe4
add shell
YanxuanLiu Aug 15, 2025
931304a
analyze
YanxuanLiu Aug 15, 2025
f6f6448
fix bug
YanxuanLiu Aug 15, 2025
f7a4f0d
fix issue
YanxuanLiu Aug 15, 2025
42a54d0
fix issue
YanxuanLiu Aug 15, 2025
9960cf8
fix
YanxuanLiu Aug 15, 2025
ac29eeb
fix bug
YanxuanLiu Aug 15, 2025
3bb1a08
add if
YanxuanLiu Aug 15, 2025
6dcaa56
optimize
YanxuanLiu Aug 15, 2025
a9cbb78
test
YanxuanLiu Aug 15, 2025
dc4f615
test
YanxuanLiu Aug 15, 2025
a09baa0
test
YanxuanLiu Aug 15, 2025
67d121d
test
YanxuanLiu Aug 15, 2025
2a0370b
test
YanxuanLiu Aug 15, 2025
3a6069f
test
YanxuanLiu Aug 15, 2025
8e5e592
change action
YanxuanLiu Aug 15, 2025
275d188
test
YanxuanLiu Aug 15, 2025
6065396
test
YanxuanLiu Aug 15, 2025
5e5e94f
fix bug
YanxuanLiu Aug 15, 2025
2b4999d
test
YanxuanLiu Aug 15, 2025
783ba8c
test
YanxuanLiu Aug 15, 2025
7f373c1
test
YanxuanLiu Aug 15, 2025
e7ea568
add step
YanxuanLiu Aug 15, 2025
fa63b89
test
YanxuanLiu Aug 17, 2025
f7920c7
optimize
YanxuanLiu Aug 17, 2025
ebef3e9
fix bug
YanxuanLiu Aug 17, 2025
b9a035a
test
YanxuanLiu Aug 17, 2025
8fb4f6f
test
YanxuanLiu Aug 17, 2025
ea4d94e
test
YanxuanLiu Aug 17, 2025
53084ea
optimize
YanxuanLiu Aug 17, 2025
480b0d6
optimize output
YanxuanLiu Aug 18, 2025
8dea0c1
optimize
YanxuanLiu Aug 18, 2025
1f0c60c
test
YanxuanLiu Aug 18, 2025
04477d0
test
YanxuanLiu Aug 18, 2025
9962551
optimize output
YanxuanLiu Aug 18, 2025
1333578
fix bug of error msg
YanxuanLiu Aug 18, 2025
916c3b6
test
YanxuanLiu Aug 18, 2025
5b34caa
optimize
YanxuanLiu Aug 18, 2025
98d072a
optimize output
YanxuanLiu Aug 18, 2025
d9b5677
optimize
YanxuanLiu Aug 18, 2025
f4a8c17
optimize
YanxuanLiu Aug 18, 2025
a9cde98
optimize
YanxuanLiu Aug 18, 2025
3a34e0b
add comments
YanxuanLiu Aug 19, 2025
c7783fb
fix nits
YanxuanLiu Aug 19, 2025
e0365d3
optimize log
YanxuanLiu Aug 19, 2025
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
32 changes: 32 additions & 0 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) 2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# A workflow to check markdown links
name: markdown link check

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
markdown-link-check:
permissions:
actions: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: NVIDIA/spark-rapids-common/checkout@main

- name: Run Markdown Link Check
uses: NVIDIA/spark-rapids-common/markdown-link-check@main
91 changes: 91 additions & 0 deletions markdown-link-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Copyright (c) 2025, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Markdown Link Check'
description: 'Check markdown links'

runs:
using: "composite"
steps:
- name: Run markdown link check
id: markdown-link-check
uses: tcort/github-action-markdown-link-check@v1
with:
max-depth: -1
use-verbose-mode: 'yes'
base-branch: 'gh-pages'

- name: Summarize results
shell: bash
if: always()
run: |
set -e

has_errors=0
current_file=""
files=()
summaries=()
in_summary_section=0 # 0: not in summary section, 1: in summary section

# Process output line by line
while IFS= read -r line; do
# Detect file header lines
if [[ "$line" =~ ^FILE:[[:space:]]*(.+) ]]; then
current_file="${BASH_REMATCH[1]}"
in_summary_section=0

# Detect start of summary section (after "n links checked.")
elif [[ "$line" =~ ^[[:space:]]*[0-9]+[[:space:]]*links[[:space:]]*checked\. ]]; then
if [ -n "$current_file" ]; then
in_summary_section=1
# Start new summary for this file
files+=("$current_file")
summaries+=("Details:")
fi

# Collect summary content
elif [ $in_summary_section -eq 1 ] && [ -n "$current_file" ]; then
# Add to current summary
last_index=$((${#summaries[@]} - 1))
summaries[$last_index]+=$'\n'"$line"

# Check if this line indicates an error
if [[ "$line" =~ ERROR: ]] || [[ "$line" =~ \[✖\] ]]; then
has_errors=1
fi
fi
done <<< "$MLC_OUTPUT" # The output of the markdown link check action

# Output final conclusion
if [ $has_errors -eq 0 ]; then
echo "=========== All links are valid ==========="
exit 0
fi

echo "=========== Found error links ==========="
# Output error details
for i in "${!files[@]}"; do
filename="${files[$i]}"
summary="${summaries[$i]}"

# Only output summaries that contain errors
if [[ "$summary" =~ ERROR: ]] || [[ "$summary" =~ \[✖\] ]]; then
echo "File: $filename"
# Preserve newlines in summary
while IFS= read -r s_line; do
echo " $s_line"
done <<< "$summary"
echo # Add empty line between files
fi
done
Loading