-
Notifications
You must be signed in to change notification settings - Fork 876
DC-5259 Added Lychee Link Checker #7192
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 all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
b886e14
added workflow
aidankmcalister a521a4b
lychee checker updated
aidankmcalister d1c5be6
update link again
aidankmcalister c73c151
lychee updated
aidankmcalister 641f1ea
revert back
aidankmcalister 690121c
edit fail conditions
aidankmcalister 5702af9
check 2
aidankmcalister d54b4b3
lychee changed
aidankmcalister 3f3f88d
workign dir
aidankmcalister 44e8a7a
args updated
aidankmcalister 1907e61
added comment
aidankmcalister 59f21d8
Merge branch 'main' into DC-5259-lychee-link-checker
aidankmcalister 8a356fa
lychee tol added
aidankmcalister 1d4809b
edited toml
aidankmcalister 13089c3
typo fixed
aidankmcalister b42d699
typos
aidankmcalister fc4ed54
args renoved
aidankmcalister feb4d8b
removed include
aidankmcalister fb93839
added extensions
aidankmcalister db95bf9
minor updates
aidankmcalister 97e2dee
update
aidankmcalister cacf989
update
aidankmcalister 0de3739
update
aidankmcalister a29ad76
arg changes
aidankmcalister de06e2d
changed comment system
aidankmcalister 24566d0
cache added
aidankmcalister e2e0168
test
aidankmcalister 426be0c
output fixed
aidankmcalister f34d0ed
broken link to test
aidankmcalister d5586d7
fail on broken links
aidankmcalister 23b4f8f
sytyle changes
aidankmcalister 5ac4494
file path change
aidankmcalister 9278ed2
conflict
aidankmcalister 702a6de
exclusions
aidankmcalister 724550b
timeout and cache changes
aidankmcalister f348f2d
quiet flag
aidankmcalister 1a27ecd
name change and old toml file removed
aidankmcalister 70041f8
tanstack fixed
aidankmcalister 0bcc831
cache timeout changed to 6 hours
aidankmcalister 9ff6e13
tedt reponse
aidankmcalister ce7d186
changes
aidankmcalister b9d87fe
name change
aidankmcalister 459ce7c
broken link fixewd
aidankmcalister c6d1045
extra `EOF` removed
aidankmcalister db4e9e4
low cache number to check
aidankmcalister e860249
update to only comment on non-forked prs
aidankmcalister 5125244
cache put back to 6 hours
aidankmcalister ae63b7b
cache test 1
aidankmcalister 5e9d31e
cache check removed
aidankmcalister 88b8978
cache changed to 5 minutes for test
aidankmcalister 252e1e9
cache 3 hours
aidankmcalister 4cf78dc
concurrency checks added
aidankmcalister 19887ad
test: trigger lychee workflow
aidankmcalister 44e3675
minor text change
aidankmcalister 6b117ef
Merge branch 'main' into DC-5259-lychee-link-checker
aidankmcalister 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
Some comments aren't visible on the classic Files Changed page.
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,76 @@ | ||
| name: 🍈 Lychee | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| concurrency: | ||
| group: lychee-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| check-links: | ||
| name: Check links | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: 🍈 Lychee Link Checker | ||
| id: lychee | ||
| uses: lycheeverse/lychee-action@v2 | ||
| with: | ||
| fail: false | ||
| output: ../lychee/out.md | ||
| args: > | ||
| --cache | ||
| --max-cache-age 3h | ||
| --verbose | ||
| --no-progress | ||
| --accept 200,201,204,304,403,429 | ||
| --timeout 20 | ||
| --max-retries 5 | ||
| --retry-wait-time 5 | ||
| --max-concurrency 16 | ||
| --exclude 'http://localhost.*' | ||
| --exclude 'https://localhost.*' | ||
| --exclude 'https://dev.mysql.com/.*' | ||
| --exclude 'https://www.mysql.com/.*' | ||
| --exclude 'https://www.gnu.org/.*' | ||
| --exclude 'https://www.cockroachlabs.com/.*' | ||
| --exclude '^/.*' | ||
| './**/*.md' './**/*.mdx' | ||
| workingDirectory: "content" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.github_token }} | ||
|
|
||
| - name: 📝 Clean up Lychee Report | ||
| if: ${{ always() && github.event.pull_request.head.repo.fork == false }} | ||
| run: | | ||
| if [ -f "lychee/out.md" ]; then | ||
| # Read the original output | ||
| ORIGINAL=$(cat lychee/out.md) | ||
|
|
||
| # Create formatted output | ||
| cat > lychee/formatted.md << 'EOF' | ||
| ## 🍈 Lychee Link Check Report | ||
|
|
||
| > **Note:** Links are cached for 3 hours to avoid unnecessary requests, and speed up consecutive runs. | ||
|
|
||
| ### 📊 Results Overview | ||
|
|
||
| EOF | ||
|
|
||
| # Append the original content with title replacement | ||
| echo "$ORIGINAL" | sed 's/^# Summary$//' | sed 's/^## Summary$//' >> lychee/formatted.md | ||
| fi | ||
|
|
||
| - name: 📝 Comment Broken Links | ||
| if: ${{ always() && github.event.pull_request.head.repo.fork == false }} | ||
| uses: peter-evans/create-or-update-comment@v4 | ||
| with: | ||
| issue-number: ${{ github.event.pull_request.number }} | ||
| body-path: lychee/formatted.md | ||
aidankmcalister marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: 🚫 Fail if broken links found | ||
| if: ${{ steps.lychee.outputs.exit_code != 0 }} | ||
| run: exit ${{ steps.lychee.outputs.exit_code }} | ||
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.