forked from godotengine/godot-docs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub Actions: Check URLs using lychee
This makes it possible to be aware of dead links and replace them with other resources (such as archived versions) as soon as possible.
- Loading branch information
Showing
3 changed files
with
66 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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,31 @@ | ||
name: π Check URLs | ||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
# Every day at midnight (UTC). | ||
# URLs can decay over time. Setting up a schedule makes it possible to be warned | ||
# about dead links as soon as possible. | ||
- cron: "0 18 * * *" | ||
|
||
jobs: | ||
check-urls: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Restore lychee cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: .lycheecache | ||
key: cache-lychee-${{ github.sha }} | ||
restore-keys: cache-lychee- | ||
|
||
- name: Run lychee | ||
uses: lycheeverse/lychee-action@v2 | ||
with: | ||
args: --base . --verbose --no-progress --cache --max-cache-age 1d --exclude-path _templates/ "**/*.md" "**/*.html" "**/*.rst" | ||
|
||
- name: Fail if there were link errors | ||
run: exit ${{ steps.lc.outputs.exit_code }} |
This file contains 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,24 @@ | ||
# Don't read Godot's own URL schemes as web URLs. | ||
user://.* | ||
res://.* | ||
|
||
# Don't read WebSockets URL as web URLs. | ||
wss://.* | ||
|
||
# Security checks prevent checking the URLs of these websites automatically, | ||
# typically returning 403 errors. | ||
https://asecuritysite.com.* | ||
https://www.intel.com.* | ||
https://reddit.com.* | ||
|
||
# Don't check URLs from these websites due to frequent rate limits (error 429) or timeouts. | ||
https://github.com.* | ||
https://www.gnu.org.* | ||
https://www.meta.com.* | ||
|
||
# Not a valid URL with the GET method, which lychee always sends. | ||
# Mentioned in the class reference. | ||
https://httpbin.org/post | ||
|
||
# Class reference metnions `https://example.com/index.php` in an example, which is 404. | ||
https://example.com.* |
This file contains 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