Skip to content

Commit 7369b43

Browse files
Update Broken-links-checker-final.yml
1 parent 7f41f8d commit 7369b43

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

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

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,18 @@ jobs:
2828
echo "$files" >> $GITHUB_OUTPUT
2929
echo "EOF" >> $GITHUB_OUTPUT
3030
31-
- name: Run Lychee on Changed Files (PR)
31+
- name: Initial Lychee Check on Changed Files (PR)
3232
if: github.event_name == 'pull_request' && steps.changed-files.outputs.md_files != ''
3333
uses: lycheeverse/[email protected]
3434
with:
35+
output: lychee/pr.out
3536
args: >
36-
--verbose --no-progress --exclude-mail
37-
--exclude ^https?://
38-
--output lychee/pr.out
37+
--verbose --no-progress --exclude-mail --exclude '^https?://'
3938
${{ steps.changed-files.outputs.md_files }}
4039
env:
4140
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4241

43-
- name: Extract Affected Markdown Files (PR)
42+
- name: Extract Affected Files (PR)
4443
if: github.event_name == 'pull_request'
4544
id: affected-pr
4645
run: |
@@ -54,7 +53,7 @@ jobs:
5453
- name: Strip HTML Comments from Affected Files (PR)
5554
if: steps.affected-pr.outputs.affected_files != ''
5655
run: |
57-
echo "${{ steps.affected-pr.outputs.affected_files }}" | while read file; do
56+
echo "${{ steps.affected-pr.outputs.affected_files }}" | while read -r file; do
5857
if [ -f "$file" ]; then
5958
target="sanitized_md/$file"
6059
mkdir -p "$(dirname "$target")"
@@ -67,26 +66,24 @@ jobs:
6766
uses: lycheeverse/[email protected]
6867
with:
6968
args: >
70-
--verbose --no-progress --exclude-mail
71-
--exclude ^https?://
69+
--verbose --no-progress --exclude-mail --exclude '^https?://'
7270
sanitized_md/**/*.md
7371
env:
7472
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7573

7674
# === MANUAL MODE ===
77-
- name: Run Lychee on Entire Repo (Manual)
75+
- name: Initial Lychee Check on All Markdown (Manual)
7876
if: github.event_name == 'workflow_dispatch'
7977
uses: lycheeverse/[email protected]
8078
with:
79+
output: lychee/manual.out
8180
args: >
82-
--verbose --no-progress --exclude-mail
83-
--exclude ^https?://
84-
--output lychee/manual.out
81+
--verbose --no-progress --exclude-mail --exclude '^https?://'
8582
'**/*.md'
8683
env:
8784
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8885

89-
- name: Extract Affected Markdown Files (Manual)
86+
- name: Extract Affected Files (Manual)
9087
if: github.event_name == 'workflow_dispatch'
9188
id: affected-manual
9289
run: |
@@ -100,22 +97,20 @@ jobs:
10097
- name: Strip HTML Comments from Affected Files (Manual)
10198
if: steps.affected-manual.outputs.affected_files != ''
10299
run: |
103-
echo "${{ steps.affected-manual.outputs.affected_files }}" | while read file; do
100+
echo "${{ steps.affected-manual.outputs.affected_files }}" | while read -r file; do
104101
if [ -f "$file" ]; then
105102
target="sanitized_md/$file"
106103
mkdir -p "$(dirname "$target")"
107104
perl -0777 -pe 's/<!--.*?-->//gs' "$file" > "$target"
108105
fi
109106
done
110107
111-
- name: Re-run Lychee on Sanitized Affected Files (Manual)
108+
- name: Re-check Sanitized Affected Files (Manual)
112109
if: steps.affected-manual.outputs.affected_files != ''
113110
uses: lycheeverse/[email protected]
114111
with:
115112
args: >
116-
--verbose --no-progress --exclude-mail
117-
--exclude ^https?://
118-
--output lychee/manual-cleaned.out
113+
--verbose --no-progress --exclude-mail --exclude '^https?://'
119114
sanitized_md/**/*.md
120115
env:
121116
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)