-
Notifications
You must be signed in to change notification settings - Fork 4
custom markdown list check action #48
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
Merged
Merged
Changes from 45 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
581b93f
add markdown link check
YanxuanLiu 770c6f4
add step to analyze
YanxuanLiu b4a5fe4
add shell
YanxuanLiu 931304a
analyze
YanxuanLiu f6f6448
fix bug
YanxuanLiu f7a4f0d
fix issue
YanxuanLiu 42a54d0
fix issue
YanxuanLiu 9960cf8
fix
YanxuanLiu ac29eeb
fix bug
YanxuanLiu 3bb1a08
add if
YanxuanLiu 6dcaa56
optimize
YanxuanLiu a9cbb78
test
YanxuanLiu dc4f615
test
YanxuanLiu a09baa0
test
YanxuanLiu 67d121d
test
YanxuanLiu 2a0370b
test
YanxuanLiu 3a6069f
test
YanxuanLiu 8e5e592
change action
YanxuanLiu 275d188
test
YanxuanLiu 6065396
test
YanxuanLiu 5e5e94f
fix bug
YanxuanLiu 2b4999d
test
YanxuanLiu 783ba8c
test
YanxuanLiu 7f373c1
test
YanxuanLiu e7ea568
add step
YanxuanLiu fa63b89
test
YanxuanLiu f7920c7
optimize
YanxuanLiu ebef3e9
fix bug
YanxuanLiu b9a035a
test
YanxuanLiu 8fb4f6f
test
YanxuanLiu ea4d94e
test
YanxuanLiu 53084ea
optimize
YanxuanLiu 480b0d6
optimize output
YanxuanLiu 8dea0c1
optimize
YanxuanLiu 1f0c60c
test
YanxuanLiu 04477d0
test
YanxuanLiu 9962551
optimize output
YanxuanLiu 1333578
fix bug of error msg
YanxuanLiu 916c3b6
test
YanxuanLiu 5b34caa
optimize
YanxuanLiu 98d072a
optimize output
YanxuanLiu d9b5677
optimize
YanxuanLiu f4a8c17
optimize
YanxuanLiu a9cde98
optimize
YanxuanLiu 3a34e0b
add comments
YanxuanLiu c7783fb
fix nits
YanxuanLiu e0365d3
optimize log
YanxuanLiu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # 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: | | ||
| 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 | ||
pxLi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # 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 | ||
pxLi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.