You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/code-reviews/recipes/markdown.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,29 @@ To automate link check in your markdown files add `lycheeverse/lychee-action` ac
129
129
130
130
More information about this action options can be found at [`lychee-action` home page](https://github.com/lycheeverse/lychee-action).
131
131
132
+
> Tip: When triggered on a PR, you can skip checking links that already exist in the main branch. This approach saves time and helps avoid rate limiting issues. Example implementation based on [this recipe](https://github.com/lycheeverse/lychee-action/issues/238#issuecomment-2638242300):
133
+
>
134
+
> ```bash
135
+
> set -euxo pipefail
136
+
>
137
+
> # Remember the current commit
138
+
> currentCommit=$(git rev-parse HEAD)
139
+
>
140
+
> # Switch to the commit in main from which the current commit has branched
141
+
> git fetch origin main
142
+
> git switch --detach $(git merge-base HEAD refs/remotes/origin/main)
143
+
>
144
+
> # Collect all links that already existed in main.
145
+
> # Format them as regular expressions (by escaping special characters) and append to .lycheeignore in order to not check them again.
146
+
> lychee --dump --include-fragments . | grep '^http' | sed 's/[.^$*+?()[{|\]/\\&/g' | sed 's/^/^/; s/$/$/' >> .lycheeignore
147
+
>
148
+
> # Switch back to the original commit
149
+
> git switch --detach "$currentCommit"
150
+
>
151
+
> # Run lychee that will use the updated .lycheeignore file
152
+
> lychee -f detailed --include-fragments .
153
+
> ```
154
+
132
155
## Code Review Checklist
133
156
134
157
In addition to the [Code Review Checklist](../process-guidance/reviewer-guidance.md) you should also look for these documentation specific code review items
0 commit comments