Skip to content

Commit df35a55

Browse files
Update Broken-links-checker-final.yml
1 parent dffae56 commit df35a55

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

.github/workflows/Broken-links-checker-final.yml

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
echo "md_files<<EOF" >> $GITHUB_OUTPUT
3030
echo "$files" >> $GITHUB_OUTPUT
3131
echo "EOF" >> $GITHUB_OUTPUT
32-
3332
- name: Check Broken Links in Added/Modified Files (PR)
3433
if: github.event_name == 'pull_request' && steps.changed-files.outputs.md_files != ''
3534
uses: lycheeverse/[email protected]
@@ -50,55 +49,3 @@ jobs:
5049
output: lychee/out.md
5150
env:
5251
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53-
54-
- name: Clean lychee/out.md by removing errors inside HTML comments
55-
if: github.event_name == 'workflow_dispatch'
56-
run: |
57-
FILTERED="lychee/out.md.cleaned"
58-
> "$FILTERED"
59-
60-
awk '
61-
BEGIN { RS="### "; FS="\n" }
62-
NR == 1 { next }
63-
{
64-
header = "### " $1
65-
file_section = $1
66-
file_path = ""
67-
68-
if (match(file_section, /in (.*\.md)/, m)) {
69-
file_path = m[1]
70-
}
71-
72-
keep_section = ""
73-
for (i = 2; i <= NF; i++) {
74-
line = $i
75-
if (match(line, /\((file:\/\/[^\)]+)\)/, mfile)) {
76-
fullpath = mfile[1]
77-
localpath = substr(fullpath, 8)
78-
filename = gensub(/^.*\//, "", "g", localpath)
79-
80-
cmd = "awk \047BEGIN{incomment=0} /<!--/{incomment=1} /-->/&&incomment{incomment=0; next} incomment && index(\\\$0, \\\"" filename "\\\")>0 {exit 0} END{exit 1}\047 \"" file_path "\""
81-
status = system(cmd)
82-
83-
if (status != 0) {
84-
keep_section = keep_section line "\n"
85-
}
86-
} else {
87-
keep_section = keep_section line "\n"
88-
}
89-
}
90-
91-
if (length(keep_section) > 0) {
92-
print header "\n" keep_section >> "'"$FILTERED"'"
93-
}
94-
}
95-
' lychee/out.md
96-
97-
mv "$FILTERED" lychee/out.md
98-
99-
- name: Show Cleaned Report
100-
if: github.event_name == 'workflow_dispatch'
101-
run: |
102-
echo '```markdown'
103-
cat lychee/out.md
104-
echo '```'

0 commit comments

Comments
 (0)